iruby 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +23 -20
- data/CONTRIBUTORS +1 -0
- data/LICENSE.txt +1 -1
- data/README.md +48 -0
- data/iruby.gemspec +1 -1
- data/lib/iruby/backend.rb +1 -0
- data/lib/iruby/display.rb +4 -1
- data/lib/iruby/session.rb +5 -8
- data/lib/iruby/utils.rb +31 -26
- data/lib/iruby/version.rb +1 -1
- metadata +4 -13
- data/IRuby-Example.ipynb +0 -3363
- data/README.rdoc +0 -45
- data/examples/display.ipynb +0 -129
- data/examples/history.ipynb +0 -171
- data/examples/stdout.ipynb +0 -93
- data/examples/table.ipynb +0 -356
- data/logo/favicon.ico +0 -0
- data/logo/iruby.png +0 -0
- data/logo/iruby.svg +0 -768
- data/screenshot.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5997055eaecf58941f72ef81ab8a064af9bbba7d
|
4
|
+
data.tar.gz: 067064e844eaddbcc56ea5857dfc4c6e868aa210
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5bdc608880d0a01a44fb2ec1280725fa87b190c4cd3465caadab36656a1218dcb93efcc48f8b6dca904c8f5b4dc92e12f8114bbc70edc61c331ab2c966185fa
|
7
|
+
data.tar.gz: c17d036173d5a1440b4a44419afff328d70d8bf2515c1d3e4b8cd9a8fdce4bf5b399f3fd812afd824e897bae4c5b1b0800696c16542eca843fdf69a6b07e0729
|
data/CHANGES
CHANGED
@@ -1,24 +1,31 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5 (2015-06-07)
|
2
|
+
|
3
|
+
* Fix #29, empty signatures
|
4
|
+
* Move iruby utils to IRuby::Utils module
|
5
|
+
* Add IRuby.tex alias for IRuby.latex
|
6
|
+
* Remove example notebooks from gem
|
7
|
+
|
8
|
+
0.2.4 (2015-06-02)
|
2
9
|
|
3
10
|
* Better exception handling
|
4
11
|
* Fix ctrl-C issue #17
|
5
12
|
* Fix timeout issue #19
|
6
13
|
|
7
|
-
0.2.3
|
14
|
+
0.2.3 (2015-05-31)
|
8
15
|
|
9
16
|
* Fix notebook indentation
|
10
17
|
* Fix tab completion for multiple lines
|
11
18
|
|
12
|
-
0.2.2
|
19
|
+
0.2.2 (2015-05-26)
|
13
20
|
|
14
21
|
* Support history variables In, Out, _, _i etc
|
15
22
|
* Internal refactoring and minor bugfixes
|
16
23
|
|
17
|
-
0.2.1
|
24
|
+
0.2.1 (2015-05-26)
|
18
25
|
|
19
26
|
* Copy Ruby logo to kernel specification
|
20
27
|
|
21
|
-
0.2.0
|
28
|
+
0.2.0 (2015-05-25)
|
22
29
|
|
23
30
|
* Dropped IPython2 support
|
24
31
|
* Dropped Ruby < 2.0.0 support
|
@@ -27,29 +34,29 @@
|
|
27
34
|
* Added IRuby::Conn (experimental, to be used by widgets)
|
28
35
|
* iruby register/unregister commands to register IRuby kernel in Jupyter
|
29
36
|
|
30
|
-
0.1.13
|
37
|
+
0.1.13 (2014-08-19)
|
31
38
|
|
32
39
|
* Improved IRuby.table, supports :maxrows and :maxcols
|
33
40
|
* IRuby#javascript workaround (https://github.com/ipython/ipython/issues/6259)
|
34
41
|
|
35
|
-
0.1.12
|
42
|
+
0.1.12 (2014-08-01)
|
36
43
|
|
37
44
|
* IRuby#table add option maxrows
|
38
45
|
* powerful display system with format and datatype registry, see #25
|
39
46
|
* Add IRuby#javascript
|
40
47
|
* Add IRuby#svg
|
41
48
|
|
42
|
-
0.1.11
|
49
|
+
0.1.11 (2014-07-08)
|
43
50
|
|
44
51
|
* Push binding if pry binding stack is empty
|
45
52
|
|
46
|
-
0.1.10
|
53
|
+
0.1.10 (2014-07-08)
|
47
54
|
|
48
55
|
* Fix #19 (pp)
|
49
56
|
* Handle exception when symlink cannot be created
|
50
57
|
* Fix dependencies and Pry backend
|
51
58
|
|
52
|
-
0.1.9
|
59
|
+
0.1.9 (2014-02-28)
|
53
60
|
|
54
61
|
* Check IPython version
|
55
62
|
|
@@ -57,37 +64,33 @@
|
|
57
64
|
|
58
65
|
* Bugfixes #11, #12, #13
|
59
66
|
|
60
|
-
0.1.6
|
67
|
+
0.1.6 (2013-10-11)
|
61
68
|
|
62
69
|
* Print Matrix and GSL::Matrix as LaTeX
|
63
70
|
* Add check for Pry version
|
64
71
|
|
65
|
-
0.1.5
|
72
|
+
0.1.5 (2013-10-03)
|
66
73
|
|
67
74
|
* Implement a rich display system
|
68
75
|
* Fix error output
|
69
76
|
|
70
|
-
0.1.4
|
77
|
+
0.1.4 (2013-10-03)
|
71
78
|
|
72
79
|
* Extract display handler from kernel
|
73
80
|
* Always return a text/plain response
|
74
81
|
|
75
|
-
0.1.3
|
82
|
+
0.1.3 (2013-10-03)
|
76
83
|
|
77
84
|
* Implement missing request handlers
|
78
85
|
* Detect if Bundler is running and set kernel_cmd appropriately
|
79
86
|
* Improve Pry integration
|
80
87
|
* Add support for the gems gnuplot, gruff, rmagick and mini_magick
|
81
88
|
|
82
|
-
0.1.2
|
89
|
+
0.1.2 (2013-10-02)
|
83
90
|
|
84
91
|
* Support for Pry added
|
85
92
|
* Launch `iruby console` if plain `iruby` is started
|
86
93
|
|
87
|
-
0.1.0
|
94
|
+
0.1.0 (2013-10-02)
|
88
95
|
|
89
96
|
* Cleanup and rewrite of some parts
|
90
|
-
|
91
|
-
0.0.1
|
92
|
-
|
93
|
-
* Initial version
|
data/CONTRIBUTORS
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
***The current master branch and gem version >= 0.2 are compatible with IPython3/Jupyter. If you require IPython2 support, please install an older gem version < 0.2 or use the branch ipython2***
|
2
|
+
|
3
|
+
# IRuby
|
4
|
+
|
5
|
+
This is a Ruby kernel for IPython/Jupyter and is part of [SciRuby](http://sciruby.com/). You can try it at [try.jupyter.org](http://try.jupyter.org/).
|
6
|
+
|
7
|
+

|
8
|
+
|
9
|
+
### Quick start
|
10
|
+
|
11
|
+
At first install IPython/Jupyter. I recommend an installation using virtualenv.
|
12
|
+
|
13
|
+
apt-get install python3-dev virtualenv libzmq3-dev
|
14
|
+
virtualenv -p python3 venv
|
15
|
+
source venv/bin/activate
|
16
|
+
pip install 'ipython[notebook]'
|
17
|
+
|
18
|
+
After that, install the Ruby gem.
|
19
|
+
|
20
|
+
gem install iruby
|
21
|
+
|
22
|
+
Now you can run iruby with:
|
23
|
+
|
24
|
+
iruby
|
25
|
+
iruby notebook
|
26
|
+
|
27
|
+
Take a look at the [example notebook](http://nbviewer.ipython.org/urls/raw.github.com/SciRuby/sciruby-notebooks/master/getting_started.ipynb)
|
28
|
+
and the [collection of notebooks](https://github.com/SciRuby/sciruby-notebooks/) which includes a Dockerfile to create a containerized installation of iruby
|
29
|
+
and other scientific gems. You can find the prebuild image at [dockerhub](https://registry.hub.docker.com/u/minad/sciruby-notebooks/).
|
30
|
+
|
31
|
+
|
32
|
+
### Required dependencies
|
33
|
+
|
34
|
+
* IPython/Jupyter >= 3.0.0
|
35
|
+
* libzmq >= 3.2
|
36
|
+
* Ruby >= 2.1.0
|
37
|
+
|
38
|
+
### Authors
|
39
|
+
|
40
|
+
See the [CONTRIBUTORS](CONTRIBUTORS) file.
|
41
|
+
|
42
|
+
### License
|
43
|
+
|
44
|
+
Copyright © 2013-15, IRuby contributors and the Ruby Science Foundation.
|
45
|
+
|
46
|
+
All rights reserved.
|
47
|
+
|
48
|
+
IRuby, along with [SciRuby](http://sciruby.com/), is licensed under the MIT license. See the [LICENSE.txt](LICENSE.txt) file for details.
|
data/iruby.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
File.read('Gemfile').scan(/gem\s+'(.*?)'/) { m << " * #{$1}\n" }
|
23
23
|
s.post_install_message = m << "\n"
|
24
24
|
|
25
|
-
s.required_ruby_version = '>= 2.
|
25
|
+
s.required_ruby_version = '>= 2.1.0'
|
26
26
|
|
27
27
|
s.add_development_dependency 'rake', '~> 10.4'
|
28
28
|
s.add_development_dependency 'minitest', '~> 5.6'
|
data/lib/iruby/backend.rb
CHANGED
data/lib/iruby/display.rb
CHANGED
@@ -210,7 +210,10 @@ module IRuby
|
|
210
210
|
type { Gnuplot::Plot }
|
211
211
|
format 'image/svg+xml' do |obj|
|
212
212
|
Tempfile.open('plot') do |f|
|
213
|
-
|
213
|
+
terminal = obj['terminal'].to_s.split(' ')
|
214
|
+
terminal[0] = 'svg'
|
215
|
+
terminal << 'enhanced' unless terminal.include?('noenhanced')
|
216
|
+
obj.terminal terminal.join(' ')
|
214
217
|
obj.output f.path
|
215
218
|
Gnuplot.open do |io|
|
216
219
|
io << obj.to_gplot
|
data/lib/iruby/session.rb
CHANGED
@@ -24,7 +24,7 @@ module IRuby
|
|
24
24
|
|
25
25
|
@sockets = { publish: pub_socket, reply: reply_socket }
|
26
26
|
@session = SecureRandom.uuid
|
27
|
-
|
27
|
+
unless config['key'].to_s.empty? || config['signature_scheme'].to_s.empty?
|
28
28
|
raise 'Unknown signature scheme' unless config['signature_scheme'] =~ /\Ahmac-(.*)\Z/
|
29
29
|
@hmac = OpenSSL::HMAC.new(config['key'], OpenSSL::Digest.new($1))
|
30
30
|
end
|
@@ -89,13 +89,10 @@ module IRuby
|
|
89
89
|
|
90
90
|
# Sign using HMAC
|
91
91
|
def sign(list)
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
else
|
97
|
-
''
|
98
|
-
end
|
92
|
+
return '' unless @hmac
|
93
|
+
@hmac.reset
|
94
|
+
list.each {|m| @hmac.update(m) }
|
95
|
+
@hmac.hexdigest
|
99
96
|
end
|
100
97
|
end
|
101
98
|
end
|
data/lib/iruby/utils.rb
CHANGED
@@ -1,36 +1,41 @@
|
|
1
1
|
module IRuby
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
module Utils
|
3
|
+
def convert(object, options)
|
4
|
+
Display.convert(object, options)
|
5
|
+
end
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
def display(obj, options = {})
|
8
|
+
Kernel.instance.session.send(:publish, :display_data,
|
9
|
+
data: Display.display(obj, options),
|
10
|
+
metadata: {},
|
11
|
+
source: 'ruby') unless obj.nil?
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
def table(s, **options)
|
15
|
+
html(HTML.table(s, options))
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
def latex(s)
|
19
|
+
convert(s, mime: 'text/latex')
|
20
|
+
end
|
21
|
+
alias tex latex
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
|
23
|
+
def math(s)
|
24
|
+
convert("$$#{s}$$", mime: 'text/latex')
|
25
|
+
end
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
def html(s)
|
28
|
+
convert(s, mime: 'text/html')
|
29
|
+
end
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
def javascript(s)
|
32
|
+
convert(s, mime: 'application/javascript')
|
33
|
+
end
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
+
def svg(s)
|
36
|
+
convert(s, mime: 'image/svg+xml')
|
37
|
+
end
|
35
38
|
end
|
39
|
+
|
40
|
+
extend Utils
|
36
41
|
end
|
data/lib/iruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Mendler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-06-
|
12
|
+
date: 2015-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -109,15 +109,10 @@ files:
|
|
109
109
|
- CHANGES
|
110
110
|
- CONTRIBUTORS
|
111
111
|
- Gemfile
|
112
|
-
- IRuby-Example.ipynb
|
113
112
|
- LICENSE.txt
|
114
|
-
- README.
|
113
|
+
- README.md
|
115
114
|
- Rakefile
|
116
115
|
- bin/iruby
|
117
|
-
- examples/display.ipynb
|
118
|
-
- examples/history.ipynb
|
119
|
-
- examples/stdout.ipynb
|
120
|
-
- examples/table.ipynb
|
121
116
|
- iruby.gemspec
|
122
117
|
- lib/iruby.rb
|
123
118
|
- lib/iruby/assets/kernel.css
|
@@ -135,13 +130,9 @@ files:
|
|
135
130
|
- lib/iruby/session.rb
|
136
131
|
- lib/iruby/utils.rb
|
137
132
|
- lib/iruby/version.rb
|
138
|
-
- logo/favicon.ico
|
139
|
-
- logo/iruby.png
|
140
|
-
- logo/iruby.svg
|
141
133
|
- logo/logo-32x32.png
|
142
134
|
- logo/logo-64x64.png
|
143
135
|
- logo/ruby.svg
|
144
|
-
- screenshot.png
|
145
136
|
- test/integration_test.rb
|
146
137
|
- test/iruby/multi_logger_test.rb
|
147
138
|
- test/test_helper.rb
|
@@ -165,7 +156,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
156
|
requirements:
|
166
157
|
- - ">="
|
167
158
|
- !ruby/object:Gem::Version
|
168
|
-
version: 2.
|
159
|
+
version: 2.1.0
|
169
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
161
|
requirements:
|
171
162
|
- - ">="
|