iruby 0.6.0 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -70,7 +70,7 @@ module IRubyTest
70
70
  @kernel.execute_request(msg)
71
71
 
72
72
  assert_equal({
73
- msg_types: [ "execute_input", "execute_reply", "execute_result" ],
73
+ msg_types: [ "execute_input", "execute_result", "execute_reply" ],
74
74
  execute_reply: {
75
75
  status: "ok",
76
76
  user_expressions: {},
@@ -149,5 +149,37 @@ module IRubyTest
149
149
  ],
150
150
  event_history)
151
151
  end
152
+
153
+ sub_test_case("#switch_backend!") do
154
+ sub_test_case("") do
155
+ def test_switch_backend
156
+ classes = []
157
+
158
+ # First pick the default backend class
159
+ classes << @kernel.instance_variable_get(:@backend).class
160
+
161
+ @kernel.switch_backend!(:pry)
162
+ classes << @kernel.instance_variable_get(:@backend).class
163
+
164
+ @kernel.switch_backend!(:irb)
165
+ classes << @kernel.instance_variable_get(:@backend).class
166
+
167
+ @kernel.switch_backend!(:pry)
168
+ classes << @kernel.instance_variable_get(:@backend).class
169
+
170
+ @kernel.switch_backend!(:plain)
171
+ classes << @kernel.instance_variable_get(:@backend).class
172
+
173
+ assert_equal([
174
+ IRuby::PlainBackend,
175
+ IRuby::PryBackend,
176
+ IRuby::PlainBackend,
177
+ IRuby::PryBackend,
178
+ IRuby::PlainBackend
179
+ ],
180
+ classes)
181
+ end
182
+ end
183
+ end
152
184
  end
153
185
  end
@@ -19,6 +19,13 @@ class IRubyTest::MimeTest < IRubyTest::TestBase
19
19
  assert_equal(data,
20
20
  res["application/javascript"])
21
21
  end
22
+
23
+ test("image/svg+xml") do
24
+ data = '<svg height="30" width="100"><text x="0" y="15" fill="red">SVG</text></svg>'
25
+ res = IRuby::Display.display(data, mime: "image/svg+xml")
26
+ assert_equal(data,
27
+ res["image/svg+xml"])
28
+ end
22
29
  end
23
30
  end
24
31
  end
@@ -1,6 +1,3 @@
1
- require 'stringio'
2
- require 'iruby/logger'
3
-
4
1
  class IRubyTest::MultiLoggerTest < IRubyTest::TestBase
5
2
  def test_multilogger
6
3
  out, err = StringIO.new, StringIO.new
@@ -0,0 +1,25 @@
1
+ module IRubyTest
2
+ class UtilsTest < TestBase
3
+ sub_test_case("IRuby.table") do
4
+ def setup
5
+ @data = {
6
+ X: [ 1, 2, 3 ],
7
+ Y: [ 4, 5, 6 ]
8
+ }
9
+ end
10
+ sub_test_case("without header: option") do
11
+ def test_table
12
+ result = IRuby.table(@data)
13
+ assert_include(result.object, "<th>X</th>")
14
+ end
15
+ end
16
+
17
+ sub_test_case("with header: false") do
18
+ def test_table
19
+ result = IRuby.table(@data, header: false)
20
+ assert_not_include(result.object, "<th>X</th>")
21
+ end
22
+ end
23
+ end
24
+ end
25
+ 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.6.0
4
+ version: 0.7.3
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: 2021-05-25 00:00:00.000000000 Z
12
+ date: 2021-07-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: data_uri
@@ -39,6 +39,20 @@ dependencies:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: irb
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: mime-types
44
58
  requirement: !ruby/object:Gem::Requirement
@@ -133,7 +147,7 @@ extra_rdoc_files: []
133
147
  files:
134
148
  - ".github/workflows/ubuntu.yml"
135
149
  - ".gitignore"
136
- - CHANGES
150
+ - CHANGES.md
137
151
  - Gemfile
138
152
  - LICENSE
139
153
  - README.md
@@ -199,6 +213,7 @@ files:
199
213
  - test/integration_test.rb
200
214
  - test/iruby/backend_test.rb
201
215
  - test/iruby/command_test.rb
216
+ - test/iruby/display_test.rb
202
217
  - test/iruby/event_manager_test.rb
203
218
  - test/iruby/jupyter_test.rb
204
219
  - test/iruby/kernel_test.rb
@@ -209,6 +224,7 @@ files:
209
224
  - test/iruby/session_adapter/session_adapter_test_base.rb
210
225
  - test/iruby/session_adapter_test.rb
211
226
  - test/iruby/session_test.rb
227
+ - test/iruby/utils_test.rb
212
228
  - test/run-test.rb
213
229
  homepage: https://github.com/SciRuby/iruby
214
230
  licenses:
@@ -229,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
245
  - !ruby/object:Gem::Version
230
246
  version: '0'
231
247
  requirements: []
232
- rubygems_version: 3.2.3
248
+ rubygems_version: 3.2.21
233
249
  signing_key:
234
250
  specification_version: 4
235
251
  summary: Ruby Kernel for Jupyter
@@ -238,6 +254,7 @@ test_files:
238
254
  - test/integration_test.rb
239
255
  - test/iruby/backend_test.rb
240
256
  - test/iruby/command_test.rb
257
+ - test/iruby/display_test.rb
241
258
  - test/iruby/event_manager_test.rb
242
259
  - test/iruby/jupyter_test.rb
243
260
  - test/iruby/kernel_test.rb
@@ -248,4 +265,5 @@ test_files:
248
265
  - test/iruby/session_adapter/session_adapter_test_base.rb
249
266
  - test/iruby/session_adapter_test.rb
250
267
  - test/iruby/session_test.rb
268
+ - test/iruby/utils_test.rb
251
269
  - test/run-test.rb
data/CHANGES DELETED
@@ -1,181 +0,0 @@
1
- 0.6.0 (2021-05-25)
2
-
3
- Bug Fixes:
4
- * Fix the handling of application/javascript https://github.com/SciRuby/iruby/issues/292, https://github.com/SciRuby/iruby/pull/294 (@kylekyle, @mrkn)
5
-
6
- Enhancements:
7
- * Add the `initialized` event in `IRuby::Kernel` class https://github.com/SciRuby/iruby/pull/168, https://github.com/SciRuby/iruby/pull/296 (@Yuki-Inoue, @mrkn)
8
- * Add the following four events https://github.com/SciRuby/iruby/pull/295 (@mrkn):
9
- * `pre-execute` -- occurs before every code execution
10
- * `pre-run-cell` -- occurs before every non-silent code execution
11
- * `post-execute` -- occurs after every code execution
12
- * `post-run-cell` -- occurs after every non-silent code execution
13
- * Replace Bond with IRB in PlainBackend https://github.com/SciRuby/iruby/pull/276, https://github.com/SciRuby/iruby/pull/297 (@cfis, @mrkn)
14
-
15
- 0.5.0 (2021-03-25)
16
-
17
- Bug Fixes:
18
- * Fix Jupyter console crashes issue https://github.com/SciRuby/iruby/pull/210 (@kojix2)
19
- * Fix syntax highlighting issue on Jpyter Lab https://github.com/SciRuby/iruby/issues/224 (@kojix2)
20
- * Fix interoperability issue with ruby-git https://github.com/SciRuby/iruby/pull/139 (@habemus-papadum)
21
- * Fix the issue of `$stderr.write` that cannot handle multiple arguments https://github.com/SciRuby/iruby/issues/206 (@kojix2)
22
- * Remove a buggy `inspect_request` implementation https://github.com/SciRuby/iruby/pull/119 (@LunarLanding)
23
- * Fix uninitialized constant `Fiddle` caused in initialization phase https://github.com/SciRuby/iruby/issues/264 (@MatthewSteen, @kjoix2)
24
- * Fix the issue on displaying a table https://github.com/SciRuby/iruby/pull/281 (@ankane)
25
-
26
- Enhancements:
27
- * Add `IRuby.clear_output` method https://github.com/SciRuby/iruby/pull/220 (@kojix2)
28
- * Make backtrace on exception simplify and more appropriate for code in a cell https://github.com/SciRuby/iruby/pull/249 (@zheng-yongping)
29
- * Make syntax error message more appropriate https://github.com/SciRuby/iruby/pull/251 (@zheng-yongping)
30
- * Remove top-level `In` and `Out` constants https://github.com/SciRuby/iruby/pull/229 (@kojix2)
31
- * Use text/plain for the default format of `Numo::NArray` objects https://github.com/SciRuby/iruby/pull/255 (@kojix2)
32
- * Use ffi-rzmq as the default ZeroMQ adapter https://github.com/SciRuby/iruby/pull/256 (@kojix2)
33
- * Drop rbczmq support https://github.com/SciRuby/iruby/pull/260 (@rstammer)
34
- * Add ruby-vips image support https://github.com/SciRuby/iruby/pull/279 (@ankane)
35
- * Replace mimemagic with mime-types https://github.com/SciRuby/iruby/pull/291 (@mrkn)
36
-
37
- 0.4.0 (2019-07-31)
38
-
39
- 0.3 (2017-03-26)
40
-
41
- Bug Fixes:
42
- * Disable Jupyter keyboard manager for all popups made using IRuby.popup (@kylekyle).
43
- * Fix Iruby/Input date values bug that set date fields to whatever the last date value was (@kylekyle).
44
- * Fix a bug where time strings put into prompter would give an 'out of range' error (@kylekyle).
45
-
46
- Enhancements:
47
- * Improvements to IRuby dependency detection using `Bundler::Dependencies#specs` (@kou).
48
- * Use less memory forcing pry to store only the last 3 commands in memory (@kylekyle).
49
- * Use bigger z-index that is used accross all browsers (@kylekyle).
50
- * Ability to input date values as DateTime objects in IRuby/Input (@kylekyle).
51
- * Add option to have check boxes checked by default (@kylekyle).
52
- * Option for multi-select in drop down menus in the prompter (@kylekyle).
53
- * Add support for multiple widgets using `IRuby::Input::Multiple` (@kylekyle).
54
- * Calender icon for date selector icon (@kylekyle).
55
- * Add support for Numo/NArray (@zalt50).
56
- * Text now only completes after a space (@zalt50).
57
- * Remove the DONTWAIT flag when receiving a message (@cloud-oak).
58
- * Add support for CZTop (@kou).
59
-
60
- 0.2.9 (2016-05-02)
61
-
62
- Bug Fixes:
63
- * Fix an error where a NoMethodError was being raised where a table rendered using an Array of Hashes has more than `maxcols` columns. (@CGamesPlay)
64
- * Patch PryBackend to throw unterminated string and unexpected end-of-file syntax errors (@kylekyle)
65
-
66
- Enhnacements:
67
- * Add an IRuby::Input class which provides widgets for getting inputs from users. (@kylekyle)
68
- * Add data_uri dependency (@kylekyle)
69
- * Added a clear_output display function (@mrkn)
70
- * Doc fixes for installation (@kozo2, @generall)
71
-
72
- 0.2.8 (2015-12-06)
73
-
74
- * Add compatibility with ffi-rzmq
75
- * Windows support
76
-
77
- 0.2.7 (2015-07-02)
78
-
79
- * Fix problem with autoloaded constants in Display, problem with sciruby gem
80
-
81
- 0.2.6 (2015-06-21)
82
-
83
- * Check registered kernel and Gemfile to prevent gem loading problems
84
- * Support to_tex method for the rendering
85
-
86
- 0.2.5 (2015-06-07)
87
-
88
- * Fix #29, empty signatures
89
- * Move iruby utils to IRuby::Utils module
90
- * Add IRuby.tex alias for IRuby.latex
91
- * Remove example notebooks from gem
92
-
93
- 0.2.4 (2015-06-02)
94
-
95
- * Better exception handling
96
- * Fix ctrl-C issue #17
97
- * Fix timeout issue #19
98
-
99
- 0.2.3 (2015-05-31)
100
-
101
- * Fix notebook indentation
102
- * Fix tab completion for multiple lines
103
-
104
- 0.2.2 (2015-05-26)
105
-
106
- * Support history variables In, Out, _, _i etc
107
- * Internal refactoring and minor bugfixes
108
-
109
- 0.2.1 (2015-05-26)
110
-
111
- * Copy Ruby logo to kernel specification
112
-
113
- 0.2.0 (2015-05-25)
114
-
115
- * Dropped IPython2 support
116
- * Dropped Ruby < 2.0.0 support
117
- * Supports and requires now IPython3/Jupyter
118
- * Switch from ffi-rzmq to rbczmq
119
- * Added IRuby::Conn (experimental, to be used by widgets)
120
- * iruby register/unregister commands to register IRuby kernel in Jupyter
121
-
122
- 0.1.13 (2014-08-19)
123
-
124
- * Improved IRuby.table, supports :maxrows and :maxcols
125
- * IRuby#javascript workaround (https://github.com/ipython/ipython/issues/6259)
126
-
127
- 0.1.12 (2014-08-01)
128
-
129
- * IRuby#table add option maxrows
130
- * powerful display system with format and datatype registry, see #25
131
- * Add IRuby#javascript
132
- * Add IRuby#svg
133
-
134
- 0.1.11 (2014-07-08)
135
-
136
- * Push binding if pry binding stack is empty
137
-
138
- 0.1.10 (2014-07-08)
139
-
140
- * Fix #19 (pp)
141
- * Handle exception when symlink cannot be created
142
- * Fix dependencies and Pry backend
143
-
144
- 0.1.9 (2014-02-28)
145
-
146
- * Check IPython version
147
-
148
- 0.1.7/0.1.8
149
-
150
- * Bugfixes #11, #12, #13
151
-
152
- 0.1.6 (2013-10-11)
153
-
154
- * Print Matrix and GSL::Matrix as LaTeX
155
- * Add check for Pry version
156
-
157
- 0.1.5 (2013-10-03)
158
-
159
- * Implement a rich display system
160
- * Fix error output
161
-
162
- 0.1.4 (2013-10-03)
163
-
164
- * Extract display handler from kernel
165
- * Always return a text/plain response
166
-
167
- 0.1.3 (2013-10-03)
168
-
169
- * Implement missing request handlers
170
- * Detect if Bundler is running and set kernel_cmd appropriately
171
- * Improve Pry integration
172
- * Add support for the gems gnuplot, gruff, rmagick and mini_magick
173
-
174
- 0.1.2 (2013-10-02)
175
-
176
- * Support for Pry added
177
- * Launch `iruby console` if plain `iruby` is started
178
-
179
- 0.1.0 (2013-10-02)
180
-
181
- * Cleanup and rewrite of some parts