iruby 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebb776099113b2016571a985fadf50fa9f8bc045
4
- data.tar.gz: 965ea1e7c3cfedae6de51a66a93d18fe2e734d7a
3
+ metadata.gz: 5997055eaecf58941f72ef81ab8a064af9bbba7d
4
+ data.tar.gz: 067064e844eaddbcc56ea5857dfc4c6e868aa210
5
5
  SHA512:
6
- metadata.gz: 9f1f3f9fa0dc1c8bd53c726025b95f9fc59036e81bdacc2d037ade2da5eb2b32369b1452dc869238305711122aae22d54326f96eaa2dade19c7e805b67d0f79b
7
- data.tar.gz: 3381a7c58651874fd6fdf77e73436bab81e60a8e73ab71de7d1acef40ce391e53d603b74972864bec3e591fc3610628792e5ed5f8ff404a1a3f0f576ea962c62
6
+ metadata.gz: a5bdc608880d0a01a44fb2ec1280725fa87b190c4cd3465caadab36656a1218dcb93efcc48f8b6dca904c8f5b4dc92e12f8114bbc70edc61c331ab2c966185fa
7
+ data.tar.gz: c17d036173d5a1440b4a44419afff328d70d8bf2515c1d3e4b8cd9a8fdce4bf5b399f3fd812afd824e897bae4c5b1b0800696c16542eca843fdf69a6b07e0729
data/CHANGES CHANGED
@@ -1,24 +1,31 @@
1
- 0.2.4
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
@@ -16,3 +16,4 @@ Naoki Nishida <domitry@gmail.com>
16
16
  Robby Clements <rclements@isotope11.com>
17
17
  Spacewander <spacewanderlzx@gmail.com>
18
18
  Takahiro Satoh <zalt50cc@gmail.com>
19
+ Robert Haines <robert.haines@manchester.ac.uk>
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013-2015 Damián Silvani, Min RK, Martin Sarsale, Josh Adams, Daniel Mendler
1
+ Copyright (c) 2013-2015 IRuby contributors and the Ruby Science Foundation
2
2
 
3
3
  MIT License
4
4
 
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
+ ![Screenshot](https://cloud.githubusercontent.com/assets/50754/7956845/3fa46df8-09e3-11e5-8641-f5b8669061b5.png)
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.0.0'
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
@@ -61,6 +61,7 @@ module IRuby
61
61
  end
62
62
 
63
63
  def eval(code, store_history)
64
+ @pry.last_result = nil
64
65
  unless @pry.eval(code)
65
66
  reset
66
67
  raise SystemExit
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
- obj.terminal 'svg enhanced'
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
- if config['key'] && config['signature_scheme']
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
- if @hmac
93
- @hmac.reset
94
- list.each {|m| @hmac.update(m) }
95
- @hmac.hexdigest
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
- def self.convert(object, options)
3
- Display.convert(object, options)
4
- end
2
+ module Utils
3
+ def convert(object, options)
4
+ Display.convert(object, options)
5
+ end
5
6
 
6
- def self.display(obj, options = {})
7
- Kernel.instance.session.send(:publish, :display_data,
8
- data: Display.display(obj, options),
9
- metadata: {},
10
- source: 'ruby') unless obj.nil?
11
- end
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
- def self.table(s, **options)
14
- html(HTML.table(s, options))
15
- end
14
+ def table(s, **options)
15
+ html(HTML.table(s, options))
16
+ end
16
17
 
17
- def self.latex(s)
18
- convert(s, mime: 'text/latex')
19
- end
18
+ def latex(s)
19
+ convert(s, mime: 'text/latex')
20
+ end
21
+ alias tex latex
20
22
 
21
- def self.math(s)
22
- convert("$$#{s}$$", mime: 'text/latex')
23
- end
23
+ def math(s)
24
+ convert("$$#{s}$$", mime: 'text/latex')
25
+ end
24
26
 
25
- def self.html(s)
26
- convert(s, mime: 'text/html')
27
- end
27
+ def html(s)
28
+ convert(s, mime: 'text/html')
29
+ end
28
30
 
29
- def self.javascript(s)
30
- convert(s, mime: 'application/javascript')
31
- end
31
+ def javascript(s)
32
+ convert(s, mime: 'application/javascript')
33
+ end
32
34
 
33
- def self.svg(s)
34
- convert(s, mime: 'image/svg+xml')
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
@@ -1,3 +1,3 @@
1
1
  module IRuby
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
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
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-02 00:00:00.000000000 Z
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.rdoc
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.0.0
159
+ version: 2.1.0
169
160
  required_rubygems_version: !ruby/object:Gem::Requirement
170
161
  requirements:
171
162
  - - ">="