Erlport wrapper for Elixir
Elixir Other
Latest commit d103ab3 Jan 21, 2017 @fazibear Update deps, bump version
Permalink
Failed to load latest commit information.
config initial commit Mar 24, 2016
lib Add documentations Sep 25, 2016
test update call macro Mar 30, 2016
.gitignore Add documentations Sep 25, 2016
.travis.yml add .travis Mar 25, 2016
LICENSE update readme and license Mar 25, 2016
README.md Update deps, bump version Jan 21, 2017
mix.exs Update deps, bump version Jan 21, 2017
mix.lock Update deps, bump version Jan 21, 2017

README.md

Export Package Version Build Status

Erlport wrapper for Elixir.

Installation

Add export to your list of dependencies in mix.exs:

def application do
  [applications: [:export]]
end

def deps do
  [
    {:export, "~> 0.1.0"},
  ]
end

Usage

Ruby

defmodule SomeRubyCall do
  use Export.Ruby

  def call_ruby_method
    # path to ruby files
    {:ok, ruby} = Ruby.start(ruby_lib: Path.expand("lib/ruby"))

    # call "upcase" method from "test" file with "hello" argument
    ruby |> Ruby.call("test", "upcase", ["hello"])

    # same as above but prettier
    ruby |> Ruby.call(upcase("hello"), from_file: "test")
  end
end

Python

defmodule SomePythonCall do
  use Export.Python

  def call_python_method
    # path to our python files
    {:ok, py} = Python.start(python_path: Path.expand("lib/python"))

    # call "upcase" method from "test" file with "hello" argument
    py |> Python.call("test", "upcase", ["hello"])

    # same as above but prettier
    py |> Python.call(upcase("hello"), from_file: "test")
  end
end