iruby 0.5.0 → 0.7.2

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.
@@ -1,14 +1,32 @@
1
1
  class IRubyTest::MimeTest < IRubyTest::TestBase
2
2
  sub_test_case("IRuby::Display") do
3
- def test_display_with_mime_type
4
- html = "<b>Bold Text</b>"
3
+ sub_test_case(".display") do
4
+ sub_test_case("with mime type") do
5
+ test("text/html") do
6
+ html = "<b>Bold Text</b>"
5
7
 
6
- obj = Object.new
7
- obj.define_singleton_method(:to_s) { html }
8
+ obj = Object.new
9
+ obj.define_singleton_method(:to_s) { html }
8
10
 
9
- res = IRuby::Display.display(obj, mime: "text/html")
10
- assert_equal({ plain: obj.inspect, html: html },
11
- { plain: res["text/plain"], html: res["text/html"] })
11
+ res = IRuby::Display.display(obj, mime: "text/html")
12
+ assert_equal({ plain: obj.inspect, html: html },
13
+ { plain: res["text/plain"], html: res["text/html"] })
14
+ end
15
+
16
+ test("application/javascript") do
17
+ data = "alert('Hello World!')"
18
+ res = IRuby::Display.display(data, mime: "application/javascript")
19
+ assert_equal(data,
20
+ res["application/javascript"])
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
29
+ end
12
30
  end
13
31
  end
14
32
 
@@ -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
@@ -38,6 +38,7 @@ module IRubyTest
38
38
  stub(IRuby::SessionAdapter::CztopAdapter).available? { false }
39
39
  stub(IRuby::SessionAdapter::FfirzmqAdapter).available? { false }
40
40
  stub(IRuby::SessionAdapter::PyzmqAdapter).available? { false }
41
+ stub(IRuby::SessionAdapter::TestAdapter).available? { false }
41
42
  assert_raises IRuby::SessionAdapterNotFound do
42
43
  IRuby::Session.new(@session_config)
43
44
  end
@@ -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
data/test/run-test.rb CHANGED
@@ -14,5 +14,6 @@ $LOAD_PATH.unshift(lib_dir.to_s)
14
14
  require_relative "helper"
15
15
 
16
16
  ENV["TEST_UNIT_MAX_DIFF_TARGET_STRING_SIZE"] ||= "10000"
17
+ ENV["IRUBY_TEST_SESSION_ADAPTER_NAME"] ||= "ffi-rzmq"
17
18
 
18
19
  exit Test::Unit::AutoRunner.run(true, test_dir)
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.5.0
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Mendler
@@ -9,38 +9,38 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-03-25 00:00:00.000000000 Z
12
+ date: 2021-06-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: bond
15
+ name: data_uri
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0.5'
20
+ version: '0.1'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '0.5'
27
+ version: '0.1'
28
28
  - !ruby/object:Gem::Dependency
29
- name: data_uri
29
+ name: ffi-rzmq
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '0.1'
34
+ version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '0.1'
41
+ version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: ffi-rzmq
43
+ name: irb
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
@@ -147,7 +147,7 @@ extra_rdoc_files: []
147
147
  files:
148
148
  - ".github/workflows/ubuntu.yml"
149
149
  - ".gitignore"
150
- - CHANGES
150
+ - CHANGES.md
151
151
  - Gemfile
152
152
  - LICENSE
153
153
  - README.md
@@ -168,6 +168,7 @@ files:
168
168
  - lib/iruby/comm.rb
169
169
  - lib/iruby/command.rb
170
170
  - lib/iruby/display.rb
171
+ - lib/iruby/event_manager.rb
171
172
  - lib/iruby/formatter.rb
172
173
  - lib/iruby/input.rb
173
174
  - lib/iruby/input/README.ipynb
@@ -200,6 +201,7 @@ files:
200
201
  - lib/iruby/session_adapter/cztop_adapter.rb
201
202
  - lib/iruby/session_adapter/ffirzmq_adapter.rb
202
203
  - lib/iruby/session_adapter/pyzmq_adapter.rb
204
+ - lib/iruby/session_adapter/test_adapter.rb
203
205
  - lib/iruby/utils.rb
204
206
  - lib/iruby/version.rb
205
207
  - logo/logo-32x32.png
@@ -211,7 +213,10 @@ files:
211
213
  - test/integration_test.rb
212
214
  - test/iruby/backend_test.rb
213
215
  - test/iruby/command_test.rb
216
+ - test/iruby/display_test.rb
217
+ - test/iruby/event_manager_test.rb
214
218
  - test/iruby/jupyter_test.rb
219
+ - test/iruby/kernel_test.rb
215
220
  - test/iruby/mime_test.rb
216
221
  - test/iruby/multi_logger_test.rb
217
222
  - test/iruby/session_adapter/cztop_adapter_test.rb
@@ -219,6 +224,7 @@ files:
219
224
  - test/iruby/session_adapter/session_adapter_test_base.rb
220
225
  - test/iruby/session_adapter_test.rb
221
226
  - test/iruby/session_test.rb
227
+ - test/iruby/utils_test.rb
222
228
  - test/run-test.rb
223
229
  homepage: https://github.com/SciRuby/iruby
224
230
  licenses:
@@ -248,7 +254,10 @@ test_files:
248
254
  - test/integration_test.rb
249
255
  - test/iruby/backend_test.rb
250
256
  - test/iruby/command_test.rb
257
+ - test/iruby/display_test.rb
258
+ - test/iruby/event_manager_test.rb
251
259
  - test/iruby/jupyter_test.rb
260
+ - test/iruby/kernel_test.rb
252
261
  - test/iruby/mime_test.rb
253
262
  - test/iruby/multi_logger_test.rb
254
263
  - test/iruby/session_adapter/cztop_adapter_test.rb
@@ -256,4 +265,5 @@ test_files:
256
265
  - test/iruby/session_adapter/session_adapter_test_base.rb
257
266
  - test/iruby/session_adapter_test.rb
258
267
  - test/iruby/session_test.rb
268
+ - test/iruby/utils_test.rb
259
269
  - test/run-test.rb
data/CHANGES DELETED
@@ -1,167 +0,0 @@
1
- 0.5.0 (2021-03-25)
2
-
3
- Bug Fixes:
4
- * Fix Jupyter console crashes issue https://github.com/SciRuby/iruby/pull/210 (@kojix2)
5
- * Fix syntax highlighting issue on Jpyter Lab https://github.com/SciRuby/iruby/issues/224 (@kojix2)
6
- * Fix interoperability issue with ruby-git https://github.com/SciRuby/iruby/pull/139 (@habemus-papadum)
7
- * Fix the issue of `$stderr.write` that cannot handle multiple arguments https://github.com/SciRuby/iruby/issues/206 (@kojix2)
8
- * Remove a buggy `inspect_request` implementation https://github.com/SciRuby/iruby/pull/119 (@LunarLanding)
9
- * Fix uninitialized constant `Fiddle` caused in initialization phase https://github.com/SciRuby/iruby/issues/264 (@MatthewSteen, @kjoix2)
10
- * Fix the issue on displaying a table https://github.com/SciRuby/iruby/pull/281 (@ankane)
11
-
12
- Enhancements:
13
- * Add `IRuby.clear_output` method https://github.com/SciRuby/iruby/pull/220 (@kojix2)
14
- * Make backtrace on exception simplify and more appropriate for code in a cell https://github.com/SciRuby/iruby/pull/249 (@zheng-yongping)
15
- * Make syntax error message more appropriate https://github.com/SciRuby/iruby/pull/251 (@zheng-yongping)
16
- * Remove top-level `In` and `Out` constants https://github.com/SciRuby/iruby/pull/229 (@kojix2)
17
- * Use text/plain for the default format of `Numo::NArray` objects https://github.com/SciRuby/iruby/pull/255 (@kojix2)
18
- * Use ffi-rzmq as the default ZeroMQ adapter https://github.com/SciRuby/iruby/pull/256 (@kojix2)
19
- * Drop rbczmq support https://github.com/SciRuby/iruby/pull/260 (@rstammer)
20
- * Add ruby-vips image support https://github.com/SciRuby/iruby/pull/279 (@ankane)
21
- * Replace mimemagic with mime-types https://github.com/SciRuby/iruby/pull/291 (@mrkn)
22
-
23
- 0.4.0 (2019-07-31)
24
-
25
- 0.3 (2017-03-26)
26
-
27
- Bug Fixes:
28
- * Disable Jupyter keyboard manager for all popups made using IRuby.popup (@kylekyle).
29
- * Fix Iruby/Input date values bug that set date fields to whatever the last date value was (@kylekyle).
30
- * Fix a bug where time strings put into prompter would give an 'out of range' error (@kylekyle).
31
-
32
- Enhancements:
33
- * Improvements to IRuby dependency detection using `Bundler::Dependencies#specs` (@kou).
34
- * Use less memory forcing pry to store only the last 3 commands in memory (@kylekyle).
35
- * Use bigger z-index that is used accross all browsers (@kylekyle).
36
- * Ability to input date values as DateTime objects in IRuby/Input (@kylekyle).
37
- * Add option to have check boxes checked by default (@kylekyle).
38
- * Option for multi-select in drop down menus in the prompter (@kylekyle).
39
- * Add support for multiple widgets using `IRuby::Input::Multiple` (@kylekyle).
40
- * Calender icon for date selector icon (@kylekyle).
41
- * Add support for Numo/NArray (@zalt50).
42
- * Text now only completes after a space (@zalt50).
43
- * Remove the DONTWAIT flag when receiving a message (@cloud-oak).
44
- * Add support for CZTop (@kou).
45
-
46
- 0.2.9 (2016-05-02)
47
-
48
- Bug Fixes:
49
- * Fix an error where a NoMethodError was being raised where a table rendered using an Array of Hashes has more than `maxcols` columns. (@CGamesPlay)
50
- * Patch PryBackend to throw unterminated string and unexpected end-of-file syntax errors (@kylekyle)
51
-
52
- Enhnacements:
53
- * Add an IRuby::Input class which provides widgets for getting inputs from users. (@kylekyle)
54
- * Add data_uri dependency (@kylekyle)
55
- * Added a clear_output display function (@mrkn)
56
- * Doc fixes for installation (@kozo2, @generall)
57
-
58
- 0.2.8 (2015-12-06)
59
-
60
- * Add compatibility with ffi-rzmq
61
- * Windows support
62
-
63
- 0.2.7 (2015-07-02)
64
-
65
- * Fix problem with autoloaded constants in Display, problem with sciruby gem
66
-
67
- 0.2.6 (2015-06-21)
68
-
69
- * Check registered kernel and Gemfile to prevent gem loading problems
70
- * Support to_tex method for the rendering
71
-
72
- 0.2.5 (2015-06-07)
73
-
74
- * Fix #29, empty signatures
75
- * Move iruby utils to IRuby::Utils module
76
- * Add IRuby.tex alias for IRuby.latex
77
- * Remove example notebooks from gem
78
-
79
- 0.2.4 (2015-06-02)
80
-
81
- * Better exception handling
82
- * Fix ctrl-C issue #17
83
- * Fix timeout issue #19
84
-
85
- 0.2.3 (2015-05-31)
86
-
87
- * Fix notebook indentation
88
- * Fix tab completion for multiple lines
89
-
90
- 0.2.2 (2015-05-26)
91
-
92
- * Support history variables In, Out, _, _i etc
93
- * Internal refactoring and minor bugfixes
94
-
95
- 0.2.1 (2015-05-26)
96
-
97
- * Copy Ruby logo to kernel specification
98
-
99
- 0.2.0 (2015-05-25)
100
-
101
- * Dropped IPython2 support
102
- * Dropped Ruby < 2.0.0 support
103
- * Supports and requires now IPython3/Jupyter
104
- * Switch from ffi-rzmq to rbczmq
105
- * Added IRuby::Conn (experimental, to be used by widgets)
106
- * iruby register/unregister commands to register IRuby kernel in Jupyter
107
-
108
- 0.1.13 (2014-08-19)
109
-
110
- * Improved IRuby.table, supports :maxrows and :maxcols
111
- * IRuby#javascript workaround (https://github.com/ipython/ipython/issues/6259)
112
-
113
- 0.1.12 (2014-08-01)
114
-
115
- * IRuby#table add option maxrows
116
- * powerful display system with format and datatype registry, see #25
117
- * Add IRuby#javascript
118
- * Add IRuby#svg
119
-
120
- 0.1.11 (2014-07-08)
121
-
122
- * Push binding if pry binding stack is empty
123
-
124
- 0.1.10 (2014-07-08)
125
-
126
- * Fix #19 (pp)
127
- * Handle exception when symlink cannot be created
128
- * Fix dependencies and Pry backend
129
-
130
- 0.1.9 (2014-02-28)
131
-
132
- * Check IPython version
133
-
134
- 0.1.7/0.1.8
135
-
136
- * Bugfixes #11, #12, #13
137
-
138
- 0.1.6 (2013-10-11)
139
-
140
- * Print Matrix and GSL::Matrix as LaTeX
141
- * Add check for Pry version
142
-
143
- 0.1.5 (2013-10-03)
144
-
145
- * Implement a rich display system
146
- * Fix error output
147
-
148
- 0.1.4 (2013-10-03)
149
-
150
- * Extract display handler from kernel
151
- * Always return a text/plain response
152
-
153
- 0.1.3 (2013-10-03)
154
-
155
- * Implement missing request handlers
156
- * Detect if Bundler is running and set kernel_cmd appropriately
157
- * Improve Pry integration
158
- * Add support for the gems gnuplot, gruff, rmagick and mini_magick
159
-
160
- 0.1.2 (2013-10-02)
161
-
162
- * Support for Pry added
163
- * Launch `iruby console` if plain `iruby` is started
164
-
165
- 0.1.0 (2013-10-02)
166
-
167
- * Cleanup and rewrite of some parts