jupyter_on_rails 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9711a06562424b6dcf2542d0469e883c0b0e0bbd00466a0e924f3f9e5906d786
4
- data.tar.gz: 95af53e3de6c917318e7fe46b395cbbb82acb06c19504403ae1597269c7827f8
3
+ metadata.gz: 2268bbfe0e3ad39f35573c40385e05fcf526b24dc942ffa1c99942bdf2efffb9
4
+ data.tar.gz: 127d4f8764f90c27ad74cb9ea8b2ea3ed9148ea156ecbc8189409aba9bf22de8
5
5
  SHA512:
6
- metadata.gz: fce6869b2b66ad33be239e6a80688023cf2491d4eb8a3779b8cd10f2bc2f0d84e36bbf2f82cdd5e3eca84de7dc40d07f67a741e95b1f87adad0d7f68e7f26be5
7
- data.tar.gz: d5bad91c4e293a8e2b88f645735cbe1a22061cf23dab010c091561ff57008b2bc9376a3c0cc3e6e33a5b7b9271a58b8fc3c07fd8358acefa70e3d4c5563dd613
6
+ metadata.gz: 631d2aa1fd6a8131a8b508355f5520a3375670feac73e5f0abe14a3067617c54392cbdd9ab554153a5bc0d87fc5c3ba71c3fb52c4219752fce4d4374d6370666
7
+ data.tar.gz: 034fe771d3ca2f45db395ce3d259eb76186523423e7fc9a21f9f64f2c473b24ed28bab73b856d06961bb519412c004286144cad4bb31c712567ff2e084a7178d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jupyter_on_rails (0.8.1)
4
+ jupyter_on_rails (0.9.0)
5
5
  daru
6
6
  iruby
7
7
  railties
@@ -30,28 +30,61 @@ GEM
30
30
  zeitwerk (~> 2.3)
31
31
  addressable (2.7.0)
32
32
  public_suffix (>= 2.0.2, < 5.0)
33
- ast (2.4.1)
33
+ ast (2.4.2)
34
+ async (1.29.0)
35
+ console (~> 1.10)
36
+ nio4r (~> 2.3)
37
+ timers (~> 4.1)
38
+ async-http (0.56.2)
39
+ async (~> 1.25)
40
+ async-io (~> 1.28)
41
+ async-pool (~> 0.2)
42
+ protocol-http (~> 0.22.0)
43
+ protocol-http1 (~> 0.14.0)
44
+ protocol-http2 (~> 0.14.0)
45
+ async-http-faraday (0.9.0)
46
+ async-http (~> 0.42)
47
+ faraday
48
+ async-io (1.31.0)
49
+ async (~> 1.14)
50
+ async-pool (0.3.6)
51
+ async (~> 1.25)
34
52
  backports (3.21.0)
35
- bond (0.5.1)
36
53
  builder (3.2.4)
37
- bump (0.9.0)
54
+ bump (0.10.0)
38
55
  concurrent-ruby (1.1.8)
56
+ console (1.12.0)
57
+ fiber-local
39
58
  crass (1.0.6)
40
59
  daru (0.3)
41
60
  packable (~> 1.3.13)
42
61
  data_uri (0.1.0)
43
62
  erubi (1.10.0)
44
- faraday (1.0.1)
63
+ faraday (1.4.2)
64
+ faraday-em_http (~> 1.0)
65
+ faraday-em_synchrony (~> 1.0)
66
+ faraday-excon (~> 1.1)
67
+ faraday-net_http (~> 1.0)
68
+ faraday-net_http_persistent (~> 1.1)
45
69
  multipart-post (>= 1.2, < 3)
70
+ ruby2_keywords (>= 0.0.4)
71
+ faraday-em_http (1.0.0)
72
+ faraday-em_synchrony (1.0.0)
73
+ faraday-excon (1.1.0)
46
74
  faraday-http-cache (2.2.0)
47
75
  faraday (>= 0.8)
48
- ffi (1.15.0)
76
+ faraday-net_http (1.0.1)
77
+ faraday-net_http_persistent (1.1.0)
78
+ ffi (1.15.1)
49
79
  ffi-rzmq (2.0.7)
50
80
  ffi-rzmq-core (>= 1.0.7)
51
81
  ffi-rzmq-core (1.0.7)
52
82
  ffi
53
- github_changelog_generator (1.15.2)
83
+ fiber-local (1.0.0)
84
+ github_changelog_generator (1.16.3)
54
85
  activesupport
86
+ async (>= 1.25.0)
87
+ async-http-faraday
55
88
  faraday-http-cache
56
89
  multi_json
57
90
  octokit (~> 4.6)
@@ -60,10 +93,13 @@ GEM
60
93
  retriable (~> 3.0)
61
94
  i18n (1.8.10)
62
95
  concurrent-ruby (~> 1.0)
63
- iruby (0.5.0)
64
- bond (~> 0.5)
96
+ io-console (0.5.9)
97
+ irb (1.3.5)
98
+ reline (>= 0.1.5)
99
+ iruby (0.7.0)
65
100
  data_uri (~> 0.1)
66
101
  ffi-rzmq
102
+ irb
67
103
  mime-types (>= 3.3.1)
68
104
  multi_json (~> 1.11)
69
105
  loofah (2.9.1)
@@ -75,20 +111,28 @@ GEM
75
111
  mime-types-data (3.2021.0225)
76
112
  mini_portile2 (2.5.1)
77
113
  minitest (5.14.4)
78
- multi_json (1.14.1)
114
+ multi_json (1.15.0)
79
115
  multipart-post (2.1.1)
80
- nokogiri (1.11.3)
116
+ nio4r (2.5.7)
117
+ nokogiri (1.11.6)
81
118
  mini_portile2 (~> 2.5.0)
82
119
  racc (~> 1.4)
83
- octokit (4.18.0)
120
+ octokit (4.21.0)
84
121
  faraday (>= 0.9)
85
122
  sawyer (~> 0.8.0, >= 0.5.3)
86
123
  packable (1.3.14)
87
124
  backports
88
125
  parallel (1.20.1)
89
- parser (3.0.0.0)
126
+ parser (3.0.1.1)
90
127
  ast (~> 2.4.1)
91
- public_suffix (4.0.5)
128
+ protocol-hpack (1.4.2)
129
+ protocol-http (0.22.0)
130
+ protocol-http1 (0.14.1)
131
+ protocol-http (~> 0.22)
132
+ protocol-http2 (0.14.2)
133
+ protocol-hpack (~> 1.4)
134
+ protocol-http (~> 0.18)
135
+ public_suffix (4.0.6)
92
136
  racc (1.5.2)
93
137
  rack (2.2.3)
94
138
  rack-test (1.1.0)
@@ -105,26 +149,30 @@ GEM
105
149
  rake (>= 0.8.7)
106
150
  thor (~> 1.0)
107
151
  rainbow (3.0.0)
108
- rake (13.0.1)
109
- regexp_parser (2.0.3)
152
+ rake (13.0.3)
153
+ regexp_parser (2.1.1)
154
+ reline (0.2.5)
155
+ io-console (~> 0.5)
110
156
  retriable (3.1.2)
111
157
  rexml (3.2.5)
112
- rubocop (1.8.0)
158
+ rubocop (1.15.0)
113
159
  parallel (~> 1.10)
114
160
  parser (>= 3.0.0.0)
115
161
  rainbow (>= 2.2.2, < 4.0)
116
162
  regexp_parser (>= 1.8, < 3.0)
117
163
  rexml
118
- rubocop-ast (>= 1.2.0, < 2.0)
164
+ rubocop-ast (>= 1.5.0, < 2.0)
119
165
  ruby-progressbar (~> 1.7)
120
166
  unicode-display_width (>= 1.4.0, < 3.0)
121
- rubocop-ast (1.4.0)
122
- parser (>= 2.7.1.5)
167
+ rubocop-ast (1.6.0)
168
+ parser (>= 3.0.1.1)
123
169
  ruby-progressbar (1.11.0)
170
+ ruby2_keywords (0.0.4)
124
171
  sawyer (0.8.2)
125
172
  addressable (>= 2.3.5)
126
173
  faraday (> 0.8, < 2.0)
127
174
  thor (1.1.0)
175
+ timers (4.3.3)
128
176
  tzinfo (2.0.4)
129
177
  concurrent-ruby (~> 1.0)
130
178
  unicode-display_width (2.0.0)
@@ -141,4 +189,4 @@ DEPENDENCIES
141
189
  rubocop
142
190
 
143
191
  BUNDLED WITH
144
- 2.1.4
192
+ 2.2.3
@@ -1,12 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JupyterOnRails
4
- module IRubyKernelExtention
5
- class << self
6
- attr_accessor :root, :sandbox
7
- end
8
-
9
- def run
4
+ module Initializer
5
+ def self.run(root:, sandbox:)
10
6
  # Load Daru extensions
11
7
  begin
12
8
  require 'daru'
@@ -25,22 +21,18 @@ module JupyterOnRails
25
21
  end
26
22
 
27
23
  original = Dir.pwd
28
- root = IRubyKernelExtention.root
29
24
  Dir.chdir root
30
25
  app_file = File.expand_path('config/environment.rb', root)
31
26
  require app_file
32
27
  Rails.application.require_environment!
33
28
  Dir.chdir original
34
29
 
35
- if IRubyKernelExtention.sandbox
36
- ActiveRecord::Base.connection.begin_transaction(joinable: false)
30
+ return unless sandbox
37
31
 
38
- at_exit do
39
- ActiveRecord::Base.connection.rollback_transaction
40
- end
32
+ ActiveRecord::Base.connection.begin_transaction(joinable: false)
33
+ at_exit do
34
+ ActiveRecord::Base.connection.rollback_transaction
41
35
  end
42
-
43
- super
44
36
  end
45
37
  end
46
38
  end
@@ -20,12 +20,13 @@ module JupyterOnRails
20
20
  end
21
21
 
22
22
  def load_extensions
23
- require_relative 'iruby_kernel_extention'
24
- JupyterOnRails::IRubyKernelExtention.root = @root
25
- JupyterOnRails::IRubyKernelExtention.sandbox = @sandbox
23
+ require_relative 'initializer'
26
24
 
27
25
  require 'iruby'
28
- IRuby::Kernel.instance_eval { prepend JupyterOnRails::IRubyKernelExtention }
26
+ IRuby::Kernel.events.register(:initialized) do |_kernel|
27
+ JupyterOnRails::Initializer.run(root: @root, sandbox: @sandbox)
28
+ end
29
+
29
30
  IRuby::Display::Registry.instance_eval do
30
31
  match do |obj|
31
32
  obj.is_a?(ActiveRecord::Relation) ||
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JupyterOnRails
4
- VERSION = '0.8.1'
4
+ VERSION = '0.9.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jupyter_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuki INOUE
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-13 00:00:00.000000000 Z
11
+ date: 2021-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bump
@@ -130,7 +130,7 @@ files:
130
130
  - lib/jupyter_on_rails/boot_sandbox.rb
131
131
  - lib/jupyter_on_rails/daru/active_record_ext.rb
132
132
  - lib/jupyter_on_rails/daru/data_frame_ext.rb
133
- - lib/jupyter_on_rails/iruby_kernel_extention.rb
133
+ - lib/jupyter_on_rails/initializer.rb
134
134
  - lib/jupyter_on_rails/kernel.rb
135
135
  - lib/jupyter_on_rails/railtie.rb
136
136
  - lib/jupyter_on_rails/railtie/jupyter.rake
@@ -141,7 +141,7 @@ metadata:
141
141
  allowed_push_host: https://rubygems.org
142
142
  homepage_uri: https://github.com/Yuki-Inoue/jupyter_on_rails
143
143
  source_code_uri: https://github.com/Yuki-Inoue/jupyter_on_rails
144
- post_install_message:
144
+ post_install_message:
145
145
  rdoc_options: []
146
146
  require_paths:
147
147
  - lib
@@ -156,8 +156,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
158
  requirements: []
159
- rubygems_version: 3.1.4
160
- signing_key:
159
+ rubygems_version: 3.2.3
160
+ signing_key:
161
161
  specification_version: 4
162
162
  summary: Integrate jupyter into rails
163
163
  test_files: []