iruby 0.2.8 → 0.6.0

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.
Files changed (72) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ubuntu.yml +62 -0
  3. data/CHANGES +76 -0
  4. data/Gemfile +3 -1
  5. data/LICENSE +1 -1
  6. data/README.md +130 -82
  7. data/Rakefile +36 -10
  8. data/ci/Dockerfile.base.erb +41 -0
  9. data/ci/Dockerfile.main.erb +7 -0
  10. data/ci/requirements.txt +1 -0
  11. data/docker/setup.sh +15 -0
  12. data/docker/test.sh +7 -0
  13. data/iruby.gemspec +13 -17
  14. data/lib/iruby.rb +14 -6
  15. data/lib/iruby/backend.rb +41 -7
  16. data/lib/iruby/command.rb +68 -12
  17. data/lib/iruby/display.rb +80 -39
  18. data/lib/iruby/event_manager.rb +40 -0
  19. data/lib/iruby/formatter.rb +5 -4
  20. data/lib/iruby/input.rb +41 -0
  21. data/lib/iruby/input/README.ipynb +502 -0
  22. data/lib/iruby/input/README.md +299 -0
  23. data/lib/iruby/input/autoload.rb +25 -0
  24. data/lib/iruby/input/builder.rb +67 -0
  25. data/lib/iruby/input/button.rb +47 -0
  26. data/lib/iruby/input/cancel.rb +32 -0
  27. data/lib/iruby/input/checkbox.rb +74 -0
  28. data/lib/iruby/input/date.rb +37 -0
  29. data/lib/iruby/input/field.rb +31 -0
  30. data/lib/iruby/input/file.rb +57 -0
  31. data/lib/iruby/input/form.rb +77 -0
  32. data/lib/iruby/input/label.rb +27 -0
  33. data/lib/iruby/input/multiple.rb +76 -0
  34. data/lib/iruby/input/popup.rb +41 -0
  35. data/lib/iruby/input/radio.rb +59 -0
  36. data/lib/iruby/input/select.rb +59 -0
  37. data/lib/iruby/input/textarea.rb +23 -0
  38. data/lib/iruby/input/widget.rb +34 -0
  39. data/lib/iruby/jupyter.rb +77 -0
  40. data/lib/iruby/kernel.rb +106 -27
  41. data/lib/iruby/ostream.rb +29 -8
  42. data/lib/iruby/session.rb +116 -0
  43. data/lib/iruby/session/{rbczmq.rb → cztop.rb} +25 -13
  44. data/lib/iruby/session/ffi_rzmq.rb +15 -2
  45. data/lib/iruby/session_adapter.rb +72 -0
  46. data/lib/iruby/session_adapter/cztop_adapter.rb +45 -0
  47. data/lib/iruby/session_adapter/ffirzmq_adapter.rb +55 -0
  48. data/lib/iruby/session_adapter/pyzmq_adapter.rb +77 -0
  49. data/lib/iruby/session_adapter/test_adapter.rb +49 -0
  50. data/lib/iruby/utils.rb +5 -2
  51. data/lib/iruby/version.rb +1 -1
  52. data/run-test.sh +12 -0
  53. data/tasks/ci.rake +65 -0
  54. data/test/helper.rb +133 -0
  55. data/test/integration_test.rb +22 -11
  56. data/test/iruby/backend_test.rb +37 -0
  57. data/test/iruby/command_test.rb +207 -0
  58. data/test/iruby/event_manager_test.rb +92 -0
  59. data/test/iruby/jupyter_test.rb +27 -0
  60. data/test/iruby/kernel_test.rb +153 -0
  61. data/test/iruby/mime_test.rb +43 -0
  62. data/test/iruby/multi_logger_test.rb +1 -2
  63. data/test/iruby/session_adapter/cztop_adapter_test.rb +20 -0
  64. data/test/iruby/session_adapter/ffirzmq_adapter_test.rb +20 -0
  65. data/test/iruby/session_adapter/session_adapter_test_base.rb +27 -0
  66. data/test/iruby/session_adapter_test.rb +91 -0
  67. data/test/iruby/session_test.rb +48 -0
  68. data/test/run-test.rb +19 -0
  69. metadata +132 -43
  70. data/.travis.yml +0 -16
  71. data/CONTRIBUTORS +0 -19
  72. data/test/test_helper.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3315e60fa2fabec2327df00d481249757ce9c199
4
- data.tar.gz: 33f5306f10e6f51f64483e63b96cc3055f75e118
2
+ SHA256:
3
+ metadata.gz: bc4c6b99aa811b7b1e6bf3e845c7dfa023dc26ce929dbc284836081d422c4b5f
4
+ data.tar.gz: f68c0f62665ec6bb302e460885ca6e54e93f7102b3cdf699cb67143155a6181a
5
5
  SHA512:
6
- metadata.gz: d314e35b4f4331892cb7bee54c6ca5aab5a3d86f058c8b34472672831da21d37e88093babeabb8d0daaadd1dc2ac5508310c3c3b5767c98b7ccee7d5d7335510
7
- data.tar.gz: f3543ff4d8c01cddc5c9091ffd4d78d95c3a74b5baba7efd4dc0c122487048de55f84b117d077bdde4bc3e9a90ad4db484087df0ab246b1bddd359d4ffa10b42
6
+ metadata.gz: 2de933258f837300d49209e51140276d9373ab6497c716cfe590d8e9e989d89a7e8e12410e4275c20d065e0fdfe1221c88074eb172bcadbab07c58077009d118
7
+ data.tar.gz: 3dfa8d4abbe218873e42626056d68bc24e2372f153f18316eb152ce08aa1f95c68b301cb41f7cf154ae8b5bb94324e9071296ff67f90325aed5b08dfa123cecd
@@ -0,0 +1,62 @@
1
+ name: CI
2
+
3
+ on:
4
+ - push
5
+ - pull_request
6
+
7
+ jobs:
8
+ test:
9
+ name: Test
10
+ runs-on: ${{ matrix.os }}
11
+
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os:
16
+ - ubuntu-20.04
17
+ - ubuntu-latest
18
+ ruby:
19
+ - 3.0
20
+ - 2.7
21
+ - 2.6
22
+ - 2.5
23
+ - 2.4
24
+ - 2.3
25
+ - debug
26
+
27
+ steps:
28
+ - uses: actions/checkout@v2
29
+ with:
30
+ fetch-depth: 1
31
+
32
+ - uses: ruby/setup-ruby@v1
33
+ with:
34
+ ruby-version: ${{ matrix.ruby }}
35
+
36
+ - name: Install requirements on ubuntu
37
+ run: |
38
+ sudo apt install -y --no-install-recommends \
39
+ libczmq-dev \
40
+ python3 \
41
+ python3-pip \
42
+ python3-setuptools
43
+ sudo pip3 install wheel
44
+ sudo pip3 install -r ci/requirements.txt
45
+
46
+ - run: gem install bundler
47
+
48
+ - run: bundle install --jobs 4 --retry 3
49
+
50
+ - name: Run tests
51
+ env:
52
+ PYTHON: python3
53
+ ADAPTERS: cztop ffi-rzmq pyzmq
54
+ run: |
55
+ for adapter in $ADAPTERS; do
56
+ export IRUBY_TEST_SESSION_ADAPTER_NAME=$adapter
57
+ bundle exec rake test TESTOPTS=-v
58
+ done
59
+
60
+ - run: rake build
61
+
62
+ - run: gem install pkg/*.gem
data/CHANGES CHANGED
@@ -1,3 +1,79 @@
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
+
1
77
  0.2.7 (2015-07-02)
2
78
 
3
79
  * Fix problem with autoloaded constants in Display, problem with sciruby gem
data/Gemfile CHANGED
@@ -10,6 +10,8 @@ end
10
10
  group :plot do
11
11
  gem 'gnuplot'
12
12
  gem 'rubyvis'
13
- gem 'nyaplot', github: 'domitry/nyaplot'
14
13
  end
15
14
 
15
+ group :test do
16
+ gem 'cztop'
17
+ end
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013-2015 IRuby contributors and the Ruby Science Foundation
1
+ Copyright (c) 2013 - present IRuby contributors and the Ruby Science Foundation
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,121 +1,169 @@
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
1
  # IRuby
4
2
 
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/).
3
+ [![Gem Version](https://badge.fury.io/rb/iruby.svg)](https://badge.fury.io/rb/iruby)
4
+ [![Build Status](https://github.com/SciRuby/iruby/workflows/CI/badge.svg)](https://github.com/SciRuby/iruby/actions)
5
+ [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/RubyData/binder/master?filepath=ruby-data.ipynb)
6
6
 
7
- ![Screenshot](https://cloud.githubusercontent.com/assets/50754/7956845/3fa46df8-09e3-11e5-8641-f5b8669061b5.png)
7
+ IRuby is a Ruby kernel for [Jupyter project](http://try.jupyter.org/).
8
8
 
9
- ### Quick start
10
- The installation instructions are divided according to environments mainly because of ZeroMQ.
9
+ ## Try IRuby
11
10
 
12
- #### Ubuntu/Debian
13
- At first install IPython/Jupyter. I recommend an installation using virtualenv.
11
+ You can try IRuby with a sample notebook on Binder (the same link as the banner placed above):
14
12
 
15
- apt-get install python3-dev virtualenv libzmq3-dev
16
- virtualenv -p python3 venv
17
- source venv/bin/activate
18
- pip install 'ipython[notebook]'
13
+ https://mybinder.org/v2/gh/RubyData/binder/master?filepath=ruby-data.ipynb
19
14
 
20
- After that, install the Ruby gem.
15
+ The following URL launches JupyterLab directly on Binder.
21
16
 
22
- gem install rbczmq
23
- gem install iruby
17
+ https://mybinder.org/v2/gh/RubyData/binder/master?filepath=../lab
24
18
 
25
- Now you can run iruby with:
19
+ ## Installation
26
20
 
27
- iruby notebook
21
+ ### Requirements
28
22
 
29
- #### Windows
30
- At first install IPython/Jupyter. I recommend an installation using [Enthought Canopy](https://www.enthought.com/).
23
+ * [Jupyter](https://jupyter.org)
24
+ * One of the following is required
25
+ * [ffi-rzmq](https://github.com/chuckremes/ffi-rzmq) and [libzmq](https://github.com/zeromq/libzmq)
26
+ * [CZTop](https://gitlab.com/paddor/cztop) and [CZMQ](https://github.com/zeromq/czmq)
31
27
 
32
- After that install libzmq.dll (v3.2.x, x86) from [the website of ZeroMQ](http://zeromq.org/area:download).
28
+ If both ffi-rzmq and cztop are installed, ffi-rzmq is used. If you prefer cztop, set the following environment variable.
33
29
 
34
- Rename `libzmq-v100-mt-3_x_x.dll` to `libzmq.dll`.
30
+ ```sh
31
+ export IRUBY_SESSION_ADAPTER="cztop"
32
+ ```
35
33
 
36
- Add the path to /bin to the PATH system variable.
34
+ * We recommend the [Pry](https://github.com/pry/pry) backend for full functionality.
35
+ * If you want to install the latest version of IRuby from the source code, try [specific_install](https://github.com/rdp/specific_install).
37
36
 
38
- Run two commands below:
37
+ ```
38
+ gem specific_install https://github.com/SciRuby/iruby
39
+ ```
39
40
 
40
- gem install ffi-rzmq
41
- gem install iruby
41
+ ### Ubuntu
42
42
 
43
- Now you can run iruby with:
43
+ Install Jupyter.
44
44
 
45
- iruby notebook
45
+ #### Ubuntu 17+
46
46
 
47
- #### Mac
48
- I recommend an installation using [Anaconda](https://store.continuum.io/cshop/anaconda/).
49
- I have not checked the installation to MacOS X, but four lines below were necessary in v0.1.x.
47
+ ```shell
48
+ sudo apt install libtool libffi-dev ruby ruby-dev make
49
+ sudo apt install libzmq3-dev libczmq-dev
50
50
 
51
- conda remove zeromq (If you installed anaconda)
52
- brew install zeromq
53
- gem install ffi-rzmq
54
- gem install iruby
51
+ gem install ffi-rzmq
52
+ gem install iruby --pre
53
+ iruby register --force
54
+ ```
55
55
 
56
- Send us pull-request if you Mac users successed in installing IRuby in another way.
56
+ #### Ubuntu 16
57
57
 
58
- #### FreeBSD
58
+ CZTop requires CZMQ >= 4.0.0 and ZMQ >= 4.2.0. The official packages for Ubuntu 16.04 don't satisfy these version requrements, so you need to install from source.
59
59
 
60
- At first install IPython/Jupyter.
61
- There is a pyzmq ports (ports/net/py-pyzmq) which depends on libzmq4, however, it doesn't works with ipython.
62
- Therefore we use libzmq3 like the following:
60
+ ```shell
61
+ sudo apt install libtool libffi-dev ruby ruby-dev make
62
+ sudo apt install git libzmq-dev autoconf pkg-config
63
+ git clone https://github.com/zeromq/czmq
64
+ cd czmq
65
+ ./autogen.sh && ./configure && sudo make && sudo make install
63
66
 
64
- 1. make your ports tree up-to-date.
65
- 2. replace LIBDEPENDS line in ports/net/py-pyzmq/Makefile
67
+ gem install cztop
68
+ gem install iruby --pre
69
+ iruby register --force
70
+ ```
66
71
 
67
- ```shell
68
- LIB_DEPENDS= libzmq.so:${PORTSDIR}/net/libzmq4
69
- ```
70
- with
71
- ```shell
72
- LIB_DEPENDS= libzmq.so:${PORTSDIR}/net/libzmq3
73
- ```
74
- 3. install related packages
72
+ ### Windows
75
73
 
76
- ```shell
77
- $ sudo pkg install libzmq3 py27-qt4-gui py27-pexpect-3.3 py27-qt4-svg py27-pygments py27-Jinja2 py27-tornado py27-jsonschema
78
- ```
79
- 4. make install using ports
74
+ Install git and Jupyter.
75
+ [DevKit](https://rubyinstaller.org/add-ons/devkit.html) is necessary for building RubyGems with native C-based extensions.
80
76
 
81
- ```shell
82
- $ cd /usr/ports/net/py-pyzmq
83
- $ sudo make install
84
- $ cd /usr/ports/devel/ipython
85
- $ sudo make install
86
- ```
87
- Then, install iruby and related ports and gems.
88
- ```shell
89
- $ sudo pkg install rubygem-mimemagic
90
- $ sudo gem install ffi-rzmq # install ffi, ffi-rzmq-core and ffi-rzmq
91
- $ git clone https://github.com/SciRuby/iruby.git
92
- $ cd iruby
93
- $ gem build iruby.gemspec
94
- $ sudo gem install iruby-0.2.7.gem
95
- ```
77
+ Install ZeroMQ.
78
+ ```shell
79
+ pacman -S mingw64/mingw-w64-x86_64-zeromq
80
+ ```
96
81
 
97
- ### After the installation
82
+ ```shell
83
+ gem install ffi-rzmq
84
+ gem install iruby --pre
85
+ iruby register --force
86
+ ```
98
87
 
99
- Take a look at the [example notebook](http://nbviewer.ipython.org/urls/raw.github.com/SciRuby/sciruby-notebooks/master/getting_started.ipynb)
100
- and the [collection of notebooks](https://github.com/SciRuby/sciruby-notebooks/) which includes a Dockerfile to create a containerized installation of iruby
101
- and other scientific gems. You can find the prebuild image at [dockerhub](https://registry.hub.docker.com/u/minad/sciruby-notebooks/).
88
+ ### macOS
89
+
90
+ Install ruby with rbenv or rvm.
91
+ Install Jupyter.
92
+
93
+ #### Homebrew
94
+
95
+ ```shell
96
+ brew install automake gmp libtool wget
97
+ brew install zeromq --HEAD
98
+ brew install czmq --HEAD
99
+ ```
100
+
101
+ ```shell
102
+ # export LIBZMQ_PATH=$(brew --prefix zeromq)/lib
103
+ # export LIBCZMQ_PATH=$(brew --prefix czmq)/lib
104
+ # gem install cztop
105
+ gem install ffi-rzmq
106
+ gem install iruby --pre
107
+ iruby register --force
108
+ ```
109
+
110
+ #### MacPorts
111
+
112
+ If you are using macports, run the following commands.
113
+
114
+ ```shell
115
+ port install libtool autoconf automake autogen
116
+ gem install ffi-rzmq
117
+ gem install iruby
118
+ ```
119
+
120
+ ### Docker
102
121
 
122
+ Try [RubyData Docker Stacks](https://github.com/RubyData/docker-stacks).
123
+ Running jupyter notebook:
103
124
 
104
- ### Required dependencies
125
+ ```shell
126
+ docker run -p 8888:8888 rubydata/datascience-notebook
127
+ ```
105
128
 
106
- * IPython/Jupyter >= 3.0.0
107
- * Ruby >= 2.1.0
129
+ ### Installation for JRuby
130
+
131
+ You can use Java classes in your IRuby notebook.
132
+
133
+ * JRuby version >= 9.0.4.0
134
+ * cztop gem
135
+ * iruby gem
136
+
137
+ After installation, make sure that your `env` is set up to use jruby.
138
+
139
+ ```shell
140
+ $ env ruby -v
141
+ ```
142
+
143
+ If you use RVM, it is enough to switch the current version to jruby.
144
+
145
+ If you have already used IRuby with a different version, you need to generate a new kernel:
146
+
147
+ ```shell
148
+ $ iruby register --force
149
+ ```
150
+
151
+ ## Notebooks
152
+
153
+ Take a look at the [example notebook](http://nbviewer.ipython.org/urls/raw.github.com/SciRuby/sciruby-notebooks/master/getting_started.ipynb)
154
+ and the [collection of notebooks](https://github.com/SciRuby/sciruby-notebooks/) which includes a Dockerfile to create a containerized installation of iruby
155
+ and other scientific gems. You can find the prebuild image at [dockerhub](https://registry.hub.docker.com/u/minad/sciruby-notebooks/).
108
156
 
109
- If you install IRuby with ffi-rzmq instead of rbczmq, libzmq >= 3.2 is added to the list above.
157
+ ## Contributing
110
158
 
111
- ### Authors
159
+ Contributions to IRuby are very welcome.
112
160
 
113
- See the [CONTRIBUTORS](CONTRIBUTORS) file.
161
+ To former contributors
114
162
 
115
- ### License
163
+ 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.
116
164
 
117
- Copyright © 2013-15, IRuby contributors and the Ruby Science Foundation.
165
+ ## License
118
166
 
119
- All rights reserved.
167
+ Copyright (c) IRuby contributors and the Ruby Science Foundation.
120
168
 
121
- IRuby, along with [SciRuby](http://sciruby.com/), is licensed under the MIT license. See the [LICENSE](LICENSE) file for details.
169
+ Licensed under the [MIT](LICENSE) license.
data/Rakefile CHANGED
@@ -1,15 +1,41 @@
1
- require 'rake/testtask'
1
+ require "bundler/gem_helper"
2
2
 
3
- begin
4
- require 'bundler/gem_tasks'
5
- rescue Exception
6
- end
3
+ base_dir = File.join(File.dirname(__FILE__))
4
+
5
+ helper = Bundler::GemHelper.new(base_dir)
6
+ helper.install
7
7
 
8
- Rake::TestTask.new('test') do |t|
9
- t.libs << 'lib'
10
- t.libs << 'test'
11
- t.test_files = FileList['test/**/*_test.rb']
12
- t.verbose = true
8
+ FileList['tasks/**.rake'].each {|f| load f }
9
+
10
+ desc "Run tests"
11
+ task :test do
12
+ cd(base_dir) do
13
+ ruby("test/run-test.rb")
14
+ end
13
15
  end
14
16
 
15
17
  task default: 'test'
18
+
19
+ namespace :docker do
20
+ def root_dir
21
+ @root_dir ||= File.expand_path("..", __FILE__)
22
+ end
23
+
24
+ task :build do
25
+ container_name = "iruby_build"
26
+ image_name = "mrkn/iruby"
27
+ sh "docker", "run",
28
+ "--name", container_name,
29
+ "-v", "#{root_dir}:/tmp/iruby",
30
+ "rubylang/ruby", "/bin/bash", "/tmp/iruby/docker/setup.sh"
31
+ sh "docker", "commit", container_name, image_name
32
+ sh "docker", "rm", container_name
33
+ end
34
+
35
+ task :test do
36
+ root_dir = File.expand_path("..", __FILE__)
37
+ sh "docker", "run", "-it", "--rm",
38
+ "-v", "#{root_dir}:/tmp/iruby",
39
+ "mrkn/iruby", "/bin/bash", "/tmp/iruby/docker/test.sh"
40
+ end
41
+ end