Page not found
+ +Sorry, but the page you were trying to get to, does not exist. You +may want to try searching this site using the sidebar or using our +API Reference page to find what +you were looking for.
+ + +diff --git a/.formatter.exs b/.formatter.exs new file mode 100755 index 0000000..ba9ede7 --- /dev/null +++ b/.formatter.exs @@ -0,0 +1,21 @@ +[ + inputs: [ + "lib/*/{lib,unicode,test}/**/*.{ex,exs}", + "lib/*/mix.exs" + ], + + locals_without_parens: [ + # Formatter tests + assert_format: 2, + assert_format: 3, + assert_same: 1, + assert_same: 2, + + # Errors tests + assert_eval_raise: 3, + + # Mix tests + in_fixture: 2, + in_tmp: 2 + ] +] \ No newline at end of file diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 062f098..26ea165 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ _build/ ebin/ deps/ mix.lock +.idea/ +*.iml diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 index c6d125b..24490d5 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,13 @@ -language: erlang -otp_release: - - 17.1 - - 17.0 -before_install: - - wget http://s3.hex.pm/builds/elixir/v1.0.0.zip - - unzip -d elixir v1.0.0.zip -before_script: - - export PATH=`pwd`/elixir/bin:$PATH - - export MIX_ENV=test - - mix local.hex --force - - mix deps.get - - mix deps.compile -script: mix test +language: elixir +env: MIX_ENV=test +notifications: + recipients: + - carlos@carloslage.net +elixir: + - 1.6 +script: + - mix format --check-formatted + - MIX_ENV=test mix test +after_script: + - MIX_ENV=dev mix deps.get + - MIX_ENV=dev mix inch.report diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 6b3a004..cbe3e79 --- a/README.md +++ b/README.md @@ -1,45 +1,69 @@ -[](https://travis-ci.org/qhool/quaff) +[](https://hex.pm/packages/quaff) +[](https://travis-ci.org/github/aruki-delivery/quaff) +[](http://inch-ci.org/aruki-delivery/quaff?branch=master) Quaff ===== Quaff is a set of tools for integrating Elixir into erlang applications (or vice versa). -Quaff.Constants +All contributions are welcome. + +Installation +===== + +Using [hex.pm](https://hex.pm/packages/quaff) (recommended way) + +Simply add ```{:quaff, "~> 1.0"}``` to your project's ```mix.exs``` file, in the dependencies list and run ```mix +deps.get quaff```. + +### Example +```elixir +defp deps do + [{:quaff, "~> 1.0"},] +end +``` + + +Quaff --------------- This module parses erlang header files, and imports any constants as `@` attributes. A constant means a `-define` macro which evaluates to a constant term, and takes no arguments (though it may use macros which accept arguments). Constants whose names start with a capital letter will have an underscore prepended, for compatibility with Elixir syntax. app/include/app_header.hrl: - -define(CONSTANT_FROM_APP,5) +```erlang +-define(CONSTANT_FROM_APP,5) +``` lib/mymodule.ex: - defmodule MyModule - require Quaff.Constants - Quaff.Constants.include_lib("app/include/app_header.hrl") - - def myfunc() do - @_CONSTANT_FROM_APP + 10 - end - end +```elixir +defmodule MyModule + require Quaff + Quaff.include_lib("app/include/app_header.hrl") + def myfunc() do + @_CONSTANT_FROM_APP + 10 + end +end +``` Quaff.Debug ----------- The Debug module provides a simple helper interface for running Elixir code in the erlang graphical debugger, using the technique I described in [this posting](http://qhool.github.io/elixir/2014/02/06/elixir-debug.html). - - Interactive Elixir (0.12.2) - press Ctrl+C to exit (type h() ENTER for help) - iex(1)> Quaff.Debug.start() #start the graphical debugger - {:ok, #PID<0.59.0>} - iex(2)> Quaff.Debug.load("./lib/mymodule.ex") #load all modules in source file - lib/mymodule.ex:1: redefining module My.Module - lib/mymodule.ex:212: redefining module My.OtherModule - [module: My.Module, module: My.OtherModule] - iex(3)> Quaff.Debug.load(Yet.AnotherModule) #load a module by name - {:module, Yet.AnotherModule} +``` +Interactive Elixir (0.12.2) - press Ctrl+C to exit (type h() ENTER for help) +iex(1)> Quaff.Debug.start() #start the graphical debugger +{:ok, #PID<0.59.0>} +iex(2)> Quaff.Debug.load("./lib/mymodule.ex") #load all modules in source file +lib/mymodule.ex:1: redefining module My.Module +lib/mymodule.ex:212: redefining module My.OtherModule +[module: My.Module, module: My.OtherModule] +iex(3)> Quaff.Debug.load(Yet.AnotherModule) #load a module by name +{:module, Yet.AnotherModule} +``` Also provided is `nload(module)` (equivalent to `load(module, all_nodes: true)`), which debugs the module[s] on all known nodes. diff --git a/doc/.build b/doc/.build new file mode 100755 index 0000000..029da30 --- /dev/null +++ b/doc/.build @@ -0,0 +1,14 @@ +dist/app-480ffdc169.css +dist/app-9bd040e5e5.js +fonts/icomoon.eot +fonts/icomoon.svg +fonts/icomoon.ttf +fonts/icomoon.woff +dist/sidebar_items-640897f7aa.js +api-reference.html +search.html +404.html +Quaff.Constants.html +Quaff.Debug.html +Quaff.CompileError.html +index.html diff --git a/doc/404.html b/doc/404.html new file mode 100755 index 0000000..73dc4c6 --- /dev/null +++ b/doc/404.html @@ -0,0 +1,105 @@ + + +
+ + + + +Sorry, but the page you were trying to get to, does not exist. You +may want to try searching this site using the sidebar or using our +API Reference page to find what +you were looking for.
+ + +Callback implementation for Exception.exception/1
Callback implementation for Exception.message/1
Callback implementation for Exception.exception/1.
Callback implementation for Exception.message/1.
=0&&(s+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-s-u-.5))),s}function U(e,t,n){var r=gt(e),i=H(e,t,r),o="border-box"===Ne.css(e,"boxSizing",!1,r),a=o;if(ht.test(i)){if(!n)return i;i="auto"}return a=a&&(xe.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===Ne.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),i=parseFloat(i)||0,i+W(e,t,n||(o?"border":"content"),a,r,i)+"px"}function K(e,t,n,r,i){return new K.prototype.init(e,t,n,r,i)}function G(){kt&&(ce.hidden===!1&&n.requestAnimationFrame?n.requestAnimationFrame(G):n.setTimeout(G,Ne.fx.interval),Ne.fx.tick())}function V(){return n.setTimeout(function(){Et=void 0}),Et=Date.now()}function X(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)n=Qe[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function Z(e,t,n){for(var r,i=(J.tweeners[t]||[]).concat(J.tweeners["*"]),o=0,a=i.length;o=0&&n","
"],col:[2,"
"],tr:[2,"","
"],td:[3,"
"],_default:[0,"",""]};it.optgroup=it.option,it.tbody=it.tfoot=it.colgroup=it.caption=it.thead,it.th=it.td;var ot=/<|?\w+;/;!function(){var e=ce.createDocumentFragment(),t=e.appendChild(ce.createElement("div")),n=ce.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),xe.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",xe.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var at=ce.documentElement,ut=/^key/,st=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,lt=/^([^.]*)(?:\.(.+)|)/;Ne.event={global:{},add:function(e,t,n,r,i){var o,a,u,s,l,c,f,p,d,h,g,v=Ue.get(e);if(v)for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&Ne.find.matchesSelector(at,i),n.guid||(n.guid=Ne.guid++),(s=v.events)||(s=v.events={}),(a=v.handle)||(a=v.handle=function(t){return"undefined"!=typeof Ne&&Ne.event.triggered!==t.type?Ne.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(qe)||[""],l=t.length;l--;)u=lt.exec(t[l])||[],d=g=u[1],h=(u[2]||"").split(".").sort(),d&&(f=Ne.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=Ne.event.special[d]||{},c=Ne.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&Ne.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=s[d])||(p=s[d]=[],p.delegateCount=0,f.setup&&f.setup.call(e,r,h,a)!==!1||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),Ne.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,a,u,s,l,c,f,p,d,h,g,v=Ue.hasData(e)&&Ue.get(e);if(v&&(s=v.events)){for(t=(t||"").match(qe)||[""],l=t.length;l--;)if(u=lt.exec(t[l])||[],d=g=u[1],h=(u[2]||"").split(".").sort(),d){for(f=Ne.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=s[d]||[],u=u[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||u&&!u.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&f.teardown.call(e,h,v.handle)!==!1||Ne.removeEvent(e,d,v.handle),delete s[d])}else for(d in s)Ne.event.remove(e,d+t[l],n,r,!0);Ne.isEmptyObject(s)&&Ue.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,u=Ne.event.fix(e),s=new Array(arguments.length),l=(Ue.get(this,"events")||{})[u.type]||[],c=Ne.event.special[u.type]||{};for(s[0]=u,t=1;t"," -1:Ne.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&u.push({elem:l,handlers:o})}return l=this,s