Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qhool/quaff
Erlang/Elixir helpers
https://github.com/qhool/quaff
Last synced: about 1 month ago
JSON representation
Erlang/Elixir helpers
- Host: GitHub
- URL: https://github.com/qhool/quaff
- Owner: qhool
- License: apache-2.0
- Created: 2014-02-09T06:27:21.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-10T18:34:24.000Z (8 months ago)
- Last Synced: 2024-08-02T02:11:40.807Z (4 months ago)
- Language: Elixir
- Size: 32.2 KB
- Stars: 82
- Watchers: 4
- Forks: 15
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - The Debug module provides a simple helper interface for running Elixir code in the erlang graphical debugger. (Debugging)
- fucking-awesome-elixir - quaff - The Debug module provides a simple helper interface for running Elixir code in the erlang graphical debugger. (Debugging)
- awesome-elixir - quaff - The Debug module provides a simple helper interface for running Elixir code in the erlang graphical debugger. (Debugging)
README
[![Build Status](https://travis-ci.org/qhool/quaff.png?branch=master)](https://travis-ci.org/qhool/quaff)
Quaff
=====Quaff is a set of tools for integrating Elixir into erlang applications (or vice versa).
Quaff.Constants
---------------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)
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
endQuaff.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}Also provided is `nload(module)` (equivalent to `load(module, all_nodes: true)`), which debugs the module[s] on all known nodes.