Skip to content

Commit

Permalink
Merge branch 'master' into feature/history_request
Browse files Browse the repository at this point in the history
  • Loading branch information
pprzetacznik committed Mar 26, 2016
2 parents 7bf65aa + c39fb89 commit 7f60c52
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 27 deletions.
18 changes: 14 additions & 4 deletions .travis.yml
@@ -1,10 +1,13 @@
language: erlang
otp_release:
- 17.1
- 18.1
- 17.5
sudo: true

before_install:
- wget http://s3.hex.pm/builds/elixir/master.zip
- unzip -d elixir master.zip
- wget http://s3.hex.pm/builds/elixir/v1.1.1.zip
- unzip -d elixir v1.1.1.zip

before_script:
- export PATH=`pwd`/elixir/bin:$PATH
- yes | mix deps.get
Expand All @@ -19,9 +22,16 @@ before_script:
- git clone -b ielixir https://github.com/pprzetacznik/jupyter_kernel_test.git
- pip install jupyter-console nose
- MIX_ENV=dev ./install_script.sh

script:
- mix test
- mix docs
- cd jupyter_kernel_test
- MIX_ENV=dev python test_ipython.py

after_script:
- cd $TRAVIS_BUILD_DIR
- MIX_ENV=docs mix deps.get
- MIX_ENV=docs mix docs
- MIX_ENV=docs mix inch.report
- MIX_ENV=test mix coveralls.travis
- MIX_ENV=dev mix coveralls.travis
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -3,9 +3,11 @@ IElixir

Jupyter's kernel for Elixir

[![Build Status](https://travis-ci.org/pprzetacznik/IElixir.svg)](https://travis-ci.org/pprzetacznik/IElixir) [![Join the chat at https://gitter.im/pprzetacznik/IElixir](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pprzetacznik/IElixir?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/pprzetacznik/IElixir.svg)](https://travis-ci.org/pprzetacznik/IElixir)
[![Inline docs](http://inch-ci.org/github/pprzetacznik/IElixir.svg?branch=master)](http://inch-ci.org/github/pprzetacznik/IElixir)
[![Join the chat at https://gitter.im/pprzetacznik/IElixir](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pprzetacznik/IElixir?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Please see generated documentation for implementation details: http://pprzetacznik.github.io/ielixir/
Please see generated documentation for implementation details: http://hexdocs.pm/ielixir/.

##Getting Started

Expand Down
21 changes: 21 additions & 0 deletions config/docs.exs
@@ -0,0 +1,21 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config

# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
# file won't be loaded nor affect the parent project. For this reason,
# if you want to provide default values for your application for third-
# party users, it should be done in your mix.exs file.

# Sample configuration:

config :logger,
level: :debug

# config :logger, :console,
# format: "$date $time [$level] $metadata$message\n",
# metadata: [:user_id]

config :ielixir, connection_file: "test/test_connection_file"

4 changes: 2 additions & 2 deletions install_script.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#!/bin/sh

mkdir -p ~/.ipython/kernels/ielixir/
START_SCRIPT_PATH=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)/start_script.sh
START_SCRIPT_PATH=$(cd `dirname "$0"` && pwd)/start_script.sh
CONTENT='{
"argv": ["'${START_SCRIPT_PATH}'", "{connection_file}"],
"display_name": "ielixir",
Expand Down
6 changes: 6 additions & 0 deletions lib/ielixir/sandbox.ex
Expand Up @@ -96,6 +96,12 @@ defmodule IElixir.Sandbox do
iex> IElixir.Sandbox.execute_code(%{"code" => "asdf"})
{:error, "CompileError", ["** (CompileError) console:1 \"undefined function asdf/0\""]}
iex> IElixir.Sandbox.execute_code(%{"code" => "hd []"})
{:error, "ArgumentError", ["** (ArgumentError) \"argument error\""]}
iex> IElixir.Sandbox.execute_code(%{"code" => "\"a\" + 5"})
{:error, "ArithmeticError", ["** %ArithmeticError{}"]}
"""
@spec execute_code(map) :: execution_response
def execute_code(request) do
Expand Down
25 changes: 21 additions & 4 deletions lib/ielixir/socket/iopub.ex
Expand Up @@ -21,22 +21,39 @@ defmodule IElixir.Socket.IOPub do
{:ok, sock}
end

@doc """
Send status of sandbox: 'ok' | 'error' | 'abort'.
"""
def send_status(status, message) do
GenServer.cast(IOPub, {:send_status, status, message})
end

@doc """
Send execute_input message. Send information about 'execution_count'.
"""
def send_execute_input(message, execution_count) do
GenServer.cast(IOPub, {:send_execute_input, message, execution_count})
end

def send_stream(message, text) do
GenServer.cast(IOPub, {:send_stream, message, text})
end

@doc """
Send execute_result message. This is used for sending what executed code
returned.
"""
def send_execute_result(message, text) do
GenServer.cast(IOPub, {:send_execute_result, message, text})
end

@doc """
Send stream message. This is used for sending output of code execution.
"""
def send_stream(message, text) do
GenServer.cast(IOPub, {:send_stream, message, text})
end

@doc """
Send error message. Send traceback so client can have information about what
went wrong.
"""
def send_error(message, execution_count, exception_name, traceback) do
GenServer.cast(IOPub, {:send_error, message, execution_count, exception_name, traceback})
end
Expand Down
25 changes: 19 additions & 6 deletions mix.exs
@@ -1,21 +1,22 @@
defmodule IElixir.Mixfile do
use Mix.Project

@version "0.9.0-dev"
@version "0.9.0"

def project do
[app: :ielixir,
version: @version,
source_url: "https://github.com/pprzetacznik/IElixir",
name: "IElixir",
elixir: "~> 1.1-dev",
elixir: ">= 1.1.0 and < 1.2.0",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps,
description: """
Jupyter's kernel for Elixir programming language
"""
]
""",
package: package,
test_coverage: [tool: ExCoveralls]]
end

def application do
Expand All @@ -32,7 +33,19 @@ defmodule IElixir.Mixfile do
{:ecto, "~> 0.15.0"},

# Docs dependencies
{:earmark, "~> 0.1", only: :dev},
{:ex_doc, "~> 0.7", only: :dev}]
{:earmark, "~> 0.1", only: :docs},
{:ex_doc, "~> 0.7", only: :docs},
{:inch_ex, "0.4.0", only: :docs},

# Test dependencies
{:excoveralls, "~> 0.3.11", only: :test}]
end

defp package do
[files: ["config", "lib", "priv", "resources", "mix.exs", "README.md", "LICENSE", "install_script.sh", "start_script.sh", ".travis.yml"],
maintainers: ["Piotr Przetacznik"],
licenses: ["Apache 2.0"],
links: %{"GitHub" => "https://github.com/pprzetacznik/ielixir",
"Docs" => "http://hexdocs.pm/ielixir/"}]
end
end
28 changes: 19 additions & 9 deletions mix.lock
@@ -1,13 +1,23 @@
%{"decimal": {:hex, :decimal, "1.1.0"},
"earmark": {:hex, :earmark, "0.1.17"},
%{"certifi": {:hex, :certifi, "0.4.0"},
"decimal": {:hex, :decimal, "1.1.1"},
"earmark": {:hex, :earmark, "0.2.1"},
"ecto": {:hex, :ecto, "0.15.0"},
"erlzmq": {:git, "git://github.com/zeromq/erlzmq2.git", "be8119254d13500bd01ca2d90637888187299393", []},
"esqlite": {:hex, :esqlite, "0.2.1"},
"ex_doc": {:hex, :ex_doc, "0.7.3"},
"erlzmq": {:git, "https://github.com/zeromq/erlzmq2.git", "7cf53b7dac4d1d4a49cf3a5925654570a42523c9", []},
"esqlite": {:hex, :esqlite, "0.2.2"},
"ex_doc": {:hex, :ex_doc, "0.11.4"},
"excoveralls": {:hex, :excoveralls, "0.3.11"},
"exjsx": {:hex, :exjsx, "3.2.0"},
"hackney": {:hex, :hackney, "1.6.0"},
"idna": {:hex, :idna, "1.2.0"},
"inch_ex": {:hex, :inch_ex, "0.4.0"},
"jsx": {:hex, :jsx, "2.6.2"},
"metrics": {:hex, :metrics, "1.0.1"},
"mimerl": {:hex, :mimerl, "1.0.2"},
"pipe": {:hex, :pipe, "0.0.2"},
"poison": {:git, "git://github.com/devinus/poison.git", "53de16a8dcb67d896d1d2b8ea91b9d506b8d83f4", []},
"poison": {:git, "https://github.com/devinus/poison.git", "7a7882e8b9877c8868eabaa6b005c813f8d6dc6b", []},
"poolboy": {:hex, :poolboy, "1.5.1"},
"quickrand": {:hex, :quickrand, "1.5.0"},
"quickrand": {:hex, :quickrand, "1.5.1"},
"sqlite_ecto": {:hex, :sqlite_ecto, "0.5.0"},
"sqlitex": {:hex, :sqlitex, "0.8.0"},
"uuid": {:git, "git://github.com/okeuday/uuid.git", "6bc38507460c821321d66504d3f8d6c1cdb57d98", []}}
"sqlitex": {:hex, :sqlitex, "0.8.3"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.0"},
"uuid": {:git, "https://github.com/okeuday/uuid.git", "c27a3f42e8b62fdf5a5ddbc708b74f9b30dba045", []}}

0 comments on commit 7f60c52

Please sign in to comment.