Vibe.IExRunner (vibe v0.1.0)

View Source

Executes Elixir code within an IEx session and returns the result.

Summary

Functions

Run the given Elixir code string in an IEx session and return the result.

Functions

run(code_string)

Run the given Elixir code string in an IEx session and return the result.

Examples

iex> Vibe.IExRunner.run("1 + 1")
{:ok, "2"}

iex> Vibe.IExRunner.run("Enum.map(1..3, &(&1 * 2))")
{:ok, "[2, 4, 6]"}

iex> Vibe.IExRunner.run("1 / 0")
{:error, "** (ArithmeticError) bad argument in arithmetic expression..."}