iruby 0.7.4 → 0.8.1
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/.github/workflows/ci.yml +102 -86
- data/CHANGES.md +31 -1
- data/Gemfile +5 -0
- data/README.md +19 -9
- data/Rakefile +2 -1
- data/exe/iruby +7 -0
- data/iruby.gemspec +3 -1
- data/lib/iruby/application.rb +380 -0
- data/lib/iruby/backend.rb +24 -3
- data/lib/iruby/comm.rb +6 -6
- data/lib/iruby/display.rb +2 -3
- data/lib/iruby/error.rb +12 -0
- data/lib/iruby/formatter.rb +1 -1
- data/lib/iruby/jupyter.rb +4 -1
- data/lib/iruby/kernel.rb +4 -2
- data/lib/iruby/kernel_app.rb +108 -0
- data/lib/iruby/logger.rb +12 -2
- data/lib/iruby/ostream.rb +1 -1
- data/lib/iruby/session/mixin.rb +2 -2
- data/lib/iruby/session.rb +4 -2
- data/lib/iruby/version.rb +1 -1
- data/test/helper.rb +22 -3
- data/test/integration_test.rb +7 -1
- data/test/iruby/application/application_test.rb +32 -0
- data/test/iruby/application/console_test.rb +97 -0
- data/test/iruby/application/helper.rb +38 -0
- data/test/iruby/application/kernel_test.rb +93 -0
- data/test/iruby/application/register_test.rb +139 -0
- data/test/iruby/application/unregister_test.rb +77 -0
- data/test/iruby/jupyter_test.rb +27 -15
- data/test/iruby/kernel_test.rb +0 -2
- data/test/iruby/multi_logger_test.rb +13 -0
- data/test/run-test.rb +1 -0
- metadata +34 -11
- data/bin/iruby +0 -5
- data/lib/iruby/command.rb +0 -190
- data/test/iruby/command_test.rb +0 -207
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d874a72b0b879122f83a0a31cd86d387bf9ead180e4f1954a42d2ec82b5de6be
|
4
|
+
data.tar.gz: 8cbe956be221da36f99cc8c550857fcc7dee567f4a4cbcf43a167ec8ce0b5a41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cc1fdaf13bf195ad4d18206c8663f693a77a1c0bcf29446c3d1c91a8e6e88fc80d8612868caa47794752dae9bcf6edc07165374fbb3637e4af1e49d8e8efa96
|
7
|
+
data.tar.gz: 9d092e97d5adc8b615f7d1f02a8fa5b52428e5c167e24e8997770a2d808e10d327a4df86fbaba8f986640110109785cd796cd5751a50ff45b298ca85037f8976
|
data/.github/workflows/ci.yml
CHANGED
@@ -2,13 +2,8 @@ name: CI
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches:
|
6
|
-
- master
|
7
5
|
pull_request:
|
8
|
-
|
9
|
-
- opened
|
10
|
-
- synchronize
|
11
|
-
- reopened
|
6
|
+
workflow_dispatch:
|
12
7
|
|
13
8
|
jobs:
|
14
9
|
ubuntu:
|
@@ -19,106 +14,127 @@ jobs:
|
|
19
14
|
fail-fast: false
|
20
15
|
matrix:
|
21
16
|
os:
|
22
|
-
|
17
|
+
- ubuntu-latest
|
23
18
|
ruby:
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
19
|
+
- "3.4"
|
20
|
+
- "3.3"
|
21
|
+
- "3.2"
|
22
|
+
- "3.1"
|
23
|
+
- "3.0"
|
24
|
+
- "2.7"
|
25
|
+
- "2.6"
|
26
|
+
- "2.5"
|
27
|
+
- debug
|
31
28
|
|
32
29
|
steps:
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
30
|
+
- uses: actions/checkout@v4
|
31
|
+
with:
|
32
|
+
fetch-depth: 1
|
33
|
+
|
34
|
+
- uses: ruby/setup-ruby@v1
|
35
|
+
with:
|
36
|
+
ruby-version: ${{ matrix.ruby }}
|
37
|
+
|
38
|
+
- run: rake build
|
39
|
+
|
40
|
+
- name: Install ffi (if Ruby 2.7)
|
41
|
+
if: |
|
42
|
+
matrix.ruby == '2.7'
|
43
|
+
run: |
|
44
|
+
cat <<GEMFILE > Gemfile.irb
|
45
|
+
source 'https://rubygems.org'
|
46
|
+
gem 'ffi'
|
47
|
+
GEMFILE
|
48
|
+
BUNDLE_GEMFILE=Gemfile.irb bundle install --jobs 4 --retry 3
|
49
|
+
|
50
|
+
- name: Install ffi 1.6.x (if Ruby 2.6)
|
51
|
+
if: |
|
52
|
+
matrix.ruby == '2.6'
|
53
|
+
run: |
|
54
|
+
cat <<GEMFILE > Gemfile.irb
|
55
|
+
source 'https://rubygems.org'
|
56
|
+
gem 'ffi', '~> 1.6.0'
|
57
|
+
GEMFILE
|
58
|
+
BUNDLE_GEMFILE=Gemfile.irb bundle install --jobs 4 --retry 3
|
59
|
+
|
60
|
+
- name: Install ffi 1.6.x and irb < 1.4.3 (if Ruby 2.5)
|
61
|
+
if: |
|
62
|
+
matrix.ruby == '2.5'
|
63
|
+
run: |
|
64
|
+
cat <<GEMFILE > Gemfile.irb
|
65
|
+
source 'https://rubygems.org'
|
66
|
+
gem 'ffi', '~> 1.6.0'
|
67
|
+
gem 'irb', '< 1.4.3'
|
68
|
+
GEMFILE
|
69
|
+
BUNDLE_GEMFILE=Gemfile.irb bundle install --jobs 4 --retry 3
|
70
|
+
|
71
|
+
- run: gem install pkg/*.gem
|
72
|
+
|
73
|
+
- run: ruby -r iruby -e "p IRuby::SessionAdapter.select_adapter_class"
|
74
|
+
env:
|
75
|
+
IRUBY_SESSION_ADAPTER: ffi-rzmq
|
76
|
+
|
77
|
+
- name: Install requirements on ubuntu
|
78
|
+
run: |
|
79
|
+
sudo apt update
|
80
|
+
sudo apt install -y --no-install-recommends \
|
81
|
+
libczmq-dev \
|
82
|
+
python3 \
|
83
|
+
python3-pip \
|
84
|
+
python3-setuptools
|
85
|
+
sudo pip3 install wheel
|
86
|
+
sudo pip3 install -r ci/requirements.txt
|
87
|
+
|
88
|
+
- run: bundle install --jobs 4 --retry 3
|
89
|
+
|
90
|
+
- name: Run tests
|
91
|
+
env:
|
92
|
+
PYTHON: python3
|
93
|
+
ADAPTERS: cztop ffi-rzmq
|
94
|
+
run: |
|
95
|
+
for adapter in $ADAPTERS; do
|
96
|
+
export IRUBY_TEST_SESSION_ADAPTER_NAME=$adapter
|
97
|
+
bundle exec rake test TESTOPTS="-v"
|
98
|
+
done
|
83
99
|
|
84
100
|
windows:
|
85
101
|
name: Windows
|
86
102
|
runs-on: windows-latest
|
87
103
|
|
88
104
|
steps:
|
89
|
-
|
90
|
-
|
91
|
-
|
105
|
+
- uses: actions/checkout@v4
|
106
|
+
with:
|
107
|
+
fetch-depth: 1
|
92
108
|
|
93
|
-
|
94
|
-
|
95
|
-
|
109
|
+
- uses: ruby/setup-ruby@v1
|
110
|
+
with:
|
111
|
+
ruby-version: "ruby"
|
96
112
|
|
97
|
-
|
113
|
+
- run: rake build
|
98
114
|
|
99
|
-
|
115
|
+
- run: gem install pkg/*.gem
|
100
116
|
|
101
|
-
|
102
|
-
|
103
|
-
|
117
|
+
- run: ruby -r iruby -e "p IRuby::SessionAdapter.select_adapter_class"
|
118
|
+
env:
|
119
|
+
IRUBY_SESSION_ADAPTER: ffi-rzmq
|
104
120
|
|
105
121
|
macos:
|
106
122
|
name: macOS
|
107
123
|
runs-on: macos-latest
|
108
124
|
|
109
125
|
steps:
|
110
|
-
|
111
|
-
|
112
|
-
|
126
|
+
- uses: actions/checkout@v4
|
127
|
+
with:
|
128
|
+
fetch-depth: 1
|
113
129
|
|
114
|
-
|
115
|
-
|
116
|
-
|
130
|
+
- uses: ruby/setup-ruby@v1
|
131
|
+
with:
|
132
|
+
ruby-version: "ruby"
|
117
133
|
|
118
|
-
|
134
|
+
- run: rake build
|
119
135
|
|
120
|
-
|
136
|
+
- run: gem install pkg/*.gem
|
121
137
|
|
122
|
-
|
123
|
-
|
124
|
-
|
138
|
+
- run: ruby -r iruby -e "p IRuby::SessionAdapter.select_adapter_class"
|
139
|
+
env:
|
140
|
+
IRUBY_SESSION_ADAPTER: ffi-rzmq
|
data/CHANGES.md
CHANGED
@@ -1,4 +1,34 @@
|
|
1
|
-
# 0.
|
1
|
+
# 0.8.1 (2025-02-16)
|
2
|
+
|
3
|
+
* Add support for jupyter widgets by @matt-do-it in https://github.com/SciRuby/iruby/pull/350
|
4
|
+
* Suppress "literal string will be frozen in the future" warning by @tikkss in https://github.com/SciRuby/iruby/pull/353
|
5
|
+
* Fix warnings in project by @simpl1g in https://github.com/SciRuby/iruby/pull/356
|
6
|
+
* restore support for IRB <= v1.13.0 by @sealocal in https://github.com/SciRuby/iruby/pull/358
|
7
|
+
* Restore ruby 2.6 and 2.5 in CI by @sealocal in https://github.com/SciRuby/iruby/pull/359
|
8
|
+
* Add Ruby 3.4 to CI by @kojix2 in https://github.com/SciRuby/iruby/pull/360
|
9
|
+
* Fix NoMethodError in backend by @edsinclair in https://github.com/SciRuby/iruby/pull/364
|
10
|
+
|
11
|
+
# 0.8.0 (2024-07-28)
|
12
|
+
|
13
|
+
* Hide output on assignment by @ankane in https://github.com/SciRuby/iruby/pull/312
|
14
|
+
* Introduce the new Application classes by @mrkn in https://github.com/SciRuby/iruby/pull/317
|
15
|
+
* Fix Gnuplot issues in Ruby 2.7 (#321) by @kojix2 in https://github.com/SciRuby/iruby/pull/322
|
16
|
+
* Add Ruby3.1 to CI by @kojix2 in https://github.com/SciRuby/iruby/pull/323
|
17
|
+
* Update README.md by @marek-witkowski in https://github.com/SciRuby/iruby/pull/324
|
18
|
+
* ci: upgrade actions/checkout by @kojix2 in https://github.com/SciRuby/iruby/pull/325
|
19
|
+
* Add Ruby 3.2 to CI for ubuntu by @petergoldstein in https://github.com/SciRuby/iruby/pull/327
|
20
|
+
* Default to true for `store_history` if not in silent mode by @gartens in https://github.com/SciRuby/iruby/pull/330
|
21
|
+
* Add Ruby 3.3 to CI for Ubuntu by @kojix2 in https://github.com/SciRuby/iruby/pull/331
|
22
|
+
* Remove Ruby 2.3 and 2.4 from CI by @kojix2 in https://github.com/SciRuby/iruby/pull/332
|
23
|
+
* Fix typos by @kojix2 in https://github.com/SciRuby/iruby/pull/335
|
24
|
+
* Format README.md and ci.yml by @kojix2 in https://github.com/SciRuby/iruby/pull/337
|
25
|
+
* Fix PlainBackend for irb v1.13.0 by @zalt50 in https://github.com/SciRuby/iruby/pull/339
|
26
|
+
* Added `date` to header by @ebababi in https://github.com/SciRuby/iruby/pull/342
|
27
|
+
* Update CI Configuration for IRuby by @kojix2 in https://github.com/SciRuby/iruby/pull/344
|
28
|
+
* Add logger and Remove base64 to Fix CI Tests by @kojix2 in https://github.com/SciRuby/iruby/pull/345
|
29
|
+
* Update CI trigger configuration by @kojix2 in https://github.com/SciRuby/iruby/pull/346
|
30
|
+
|
31
|
+
# 0.7.4 (2021-08-18)
|
2
32
|
|
3
33
|
## Enhancements
|
4
34
|
|
data/Gemfile
CHANGED
@@ -15,3 +15,8 @@ end
|
|
15
15
|
group :test do
|
16
16
|
gem 'cztop'
|
17
17
|
end
|
18
|
+
|
19
|
+
# Tests are failing on Ruby 3.3 because warnings related to OpenStruct are being written to the standard error output.
|
20
|
+
# This is being captured by Open3.capture2e and then mistakenly parsed as JSON.
|
21
|
+
# This gem can be removed when json gem is updated
|
22
|
+
gem 'ostruct'
|
data/README.md
CHANGED
@@ -10,11 +10,11 @@ IRuby is a Ruby kernel for [Jupyter project](http://try.jupyter.org/).
|
|
10
10
|
|
11
11
|
You can try IRuby with a sample notebook on Binder (the same link as the banner placed above):
|
12
12
|
|
13
|
-
https://mybinder.org/v2/gh/RubyData/binder/master?filepath=ruby-data.ipynb
|
13
|
+
<https://mybinder.org/v2/gh/RubyData/binder/master?filepath=ruby-data.ipynb>
|
14
14
|
|
15
15
|
The following URL launches JupyterLab directly on Binder.
|
16
16
|
|
17
|
-
https://mybinder.org/v2/gh/RubyData/binder/master?filepath=../lab
|
17
|
+
<https://mybinder.org/v2/gh/RubyData/binder/master?filepath=../lab>
|
18
18
|
|
19
19
|
## Installation
|
20
20
|
|
@@ -31,13 +31,12 @@ The following dependencies are optional.
|
|
31
31
|
|
32
32
|
* [Pry][Pry], if you want to use [Pry][Pry] instead of IRB for the code execution backend
|
33
33
|
|
34
|
-
|
35
34
|
### Installing Jupyter Notebook and/or JupyterLab
|
36
35
|
|
37
36
|
See the official document to know how to install Jupyter Notebook and/or JupyterLab.
|
38
37
|
|
39
|
-
* https://jupyter.readthedocs.io/en/latest/install/notebook-classic.html
|
40
|
-
* https://jupyter.readthedocs.io/en/latest/install.html
|
38
|
+
* <https://jupyter.readthedocs.io/en/latest/install/notebook-classic.html>
|
39
|
+
* <https://jupyter.readthedocs.io/en/latest/install.html>
|
41
40
|
|
42
41
|
### Ubuntu
|
43
42
|
|
@@ -62,6 +61,17 @@ gem install --user-install iruby
|
|
62
61
|
iruby register --force
|
63
62
|
```
|
64
63
|
|
64
|
+
### Fedora
|
65
|
+
|
66
|
+
#### Fedora 36
|
67
|
+
|
68
|
+
```shell
|
69
|
+
sudo dnf install ruby ruby-dev make zeromq-devel
|
70
|
+
|
71
|
+
gem install --user-install iruby
|
72
|
+
iruby register --force
|
73
|
+
```
|
74
|
+
|
65
75
|
### Windows
|
66
76
|
|
67
77
|
[DevKit](https://rubyinstaller.org/add-ons/devkit.html) is necessary for building RubyGems with native C-based extensions.
|
@@ -95,7 +105,7 @@ iruby register --force
|
|
95
105
|
|
96
106
|
### Docker
|
97
107
|
|
98
|
-
Try [RubyData Docker Stacks](https://github.com/RubyData/docker-stacks).
|
108
|
+
Try [RubyData Docker Stacks](https://github.com/RubyData/docker-stacks).
|
99
109
|
Running jupyter notebook:
|
100
110
|
|
101
111
|
```shell
|
@@ -112,7 +122,7 @@ You can use Java classes in your IRuby notebook.
|
|
112
122
|
After installation, make sure that your `env` is set up to use jruby.
|
113
123
|
|
114
124
|
```shell
|
115
|
-
|
125
|
+
env ruby -v
|
116
126
|
```
|
117
127
|
|
118
128
|
If you use RVM, it is enough to switch the current version to jruby.
|
@@ -120,7 +130,7 @@ If you use RVM, it is enough to switch the current version to jruby.
|
|
120
130
|
If you have already used IRuby with a different version, you need to generate a new kernel:
|
121
131
|
|
122
132
|
```shell
|
123
|
-
|
133
|
+
iruby register --force
|
124
134
|
```
|
125
135
|
|
126
136
|
### Install the development version of IRuby
|
@@ -171,7 +181,7 @@ Contributions to IRuby are very welcome.
|
|
171
181
|
|
172
182
|
To former contributors
|
173
183
|
|
174
|
-
In February 2021, [IRuby became the canonical repository](https://github.com/SciRuby/iruby/issues/285) and is no longer a fork from [minrk/iruby](https://github.com/minrk/iruby). Please fork from this repository again before making pull requests.
|
184
|
+
In February 2021, [IRuby became the canonical repository](https://github.com/SciRuby/iruby/issues/285) and is no longer a fork from [minrk/iruby](https://github.com/minrk/iruby). Please fork from this repository again before making pull requests.
|
175
185
|
|
176
186
|
## License
|
177
187
|
|
data/Rakefile
CHANGED
data/exe/iruby
ADDED
data/iruby.gemspec
CHANGED
@@ -11,7 +11,8 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.license = 'MIT'
|
12
12
|
|
13
13
|
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
14
|
-
s.
|
14
|
+
s.bindir = "exe"
|
15
|
+
s.executables = %w[iruby]
|
15
16
|
s.test_files = s.files.grep(%r{^test/})
|
16
17
|
s.require_paths = %w[lib]
|
17
18
|
s.extensions = %w[ext/Rakefile]
|
@@ -21,6 +22,7 @@ Gem::Specification.new do |s|
|
|
21
22
|
s.add_dependency 'data_uri', '~> 0.1'
|
22
23
|
s.add_dependency 'ffi-rzmq'
|
23
24
|
s.add_dependency 'irb'
|
25
|
+
s.add_dependency 'logger'
|
24
26
|
s.add_dependency 'mime-types', '>= 3.3.1'
|
25
27
|
s.add_dependency 'multi_json', '~> 1.11'
|
26
28
|
s.add_dependency 'native-package-installer'
|