Skip to content

3dsig/export

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 do
    # 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

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 99.4%
  • Other 0.6%