iruby 0.7.1 → 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.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -0
- data/lib/iruby/backend.rb +11 -0
- data/lib/iruby/utils.rb +1 -1
- data/lib/iruby/version.rb +1 -1
- data/test/iruby/backend_test.rb +12 -0
- data/test/iruby/utils_test.rb +25 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97c4aaa733ee27b0adb838ebed8d38cd67f857ef2466aa055105943df8647845
|
4
|
+
data.tar.gz: be54a5310326f5e052f07a2bb0625acb823618ab9b0a85dc0dedae01a86ebbc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19cb3579f143fa0b720bb1fddc1e50b17b910ba2484bd794e9d382e6b3d029675d8bda801f77b19a26afae69a9038f9779a8f50a93d4ae51dadfde53dd3168f0
|
7
|
+
data.tar.gz: 2f1adf37fb436345d110c87352bad3725ffba0068740c13e16bcd3f4be7132a9a8968bcecda43c257613d4ccd08ab7592c9bae27d60501ac393c54a0f86519cd
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# 0.7.2 (2021-06-23)
|
2
|
+
|
3
|
+
## Bug Fixes
|
4
|
+
|
5
|
+
* Fix IRuby.table for Ruby >= 2.7 https://github.com/SciRuby/iruby/pull/305 (@topofocus)
|
6
|
+
* Fix PlainBackend to include modules https://github.com/SciRuby/iruby/issues/303 (@UliKuch, @mrkn)
|
7
|
+
|
1
8
|
# 0.7.1 (2021-06-21)
|
2
9
|
|
3
10
|
## Enhancements
|
data/lib/iruby/backend.rb
CHANGED
@@ -40,6 +40,7 @@ module IRuby
|
|
40
40
|
require 'irb/completion'
|
41
41
|
IRB.setup(nil)
|
42
42
|
@main = TOPLEVEL_BINDING.eval("self").dup
|
43
|
+
init_main_object(@main)
|
43
44
|
@workspace = IRB::WorkSpace.new(@main)
|
44
45
|
@irb = IRB::Irb.new(@workspace)
|
45
46
|
@eval_path = @irb.context.irb_path
|
@@ -58,6 +59,16 @@ module IRuby
|
|
58
59
|
def complete(code)
|
59
60
|
IRB::InputCompletor::CompletionProc.call(code)
|
60
61
|
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def init_main_object(main)
|
66
|
+
wrapper_module = Module.new
|
67
|
+
main.extend(wrapper_module)
|
68
|
+
main.define_singleton_method(:include) do |*args|
|
69
|
+
wrapper_module.include(*args)
|
70
|
+
end
|
71
|
+
end
|
61
72
|
end
|
62
73
|
|
63
74
|
class PryBackend
|
data/lib/iruby/utils.rb
CHANGED
data/lib/iruby/version.rb
CHANGED
data/test/iruby/backend_test.rb
CHANGED
@@ -8,6 +8,12 @@ module IRubyTest
|
|
8
8
|
assert_equal 3, @plainbackend.eval('1+2', false)
|
9
9
|
end
|
10
10
|
|
11
|
+
def test_include_module
|
12
|
+
assert_nothing_raised do
|
13
|
+
@plainbackend.eval("include Math, Comparable", false)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
11
17
|
def test_complete_req
|
12
18
|
assert_includes @plainbackend.complete('req'), 'require'
|
13
19
|
end
|
@@ -26,6 +32,12 @@ module IRubyTest
|
|
26
32
|
assert_equal 3, @prybackend.eval('1+2', false)
|
27
33
|
end
|
28
34
|
|
35
|
+
def test_include_module
|
36
|
+
assert_nothing_raised do
|
37
|
+
@prybackend.eval("include Math, Comparable", false)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
29
41
|
def test_complete_req
|
30
42
|
assert_includes @prybackend.complete('req'), 'require'
|
31
43
|
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
|
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.7.
|
4
|
+
version: 0.7.2
|
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-06-
|
12
|
+
date: 2021-06-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: data_uri
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- test/iruby/session_adapter/session_adapter_test_base.rb
|
225
225
|
- test/iruby/session_adapter_test.rb
|
226
226
|
- test/iruby/session_test.rb
|
227
|
+
- test/iruby/utils_test.rb
|
227
228
|
- test/run-test.rb
|
228
229
|
homepage: https://github.com/SciRuby/iruby
|
229
230
|
licenses:
|
@@ -264,4 +265,5 @@ test_files:
|
|
264
265
|
- test/iruby/session_adapter/session_adapter_test_base.rb
|
265
266
|
- test/iruby/session_adapter_test.rb
|
266
267
|
- test/iruby/session_test.rb
|
268
|
+
- test/iruby/utils_test.rb
|
267
269
|
- test/run-test.rb
|