jupyter_on_rails 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/.rubocop.yml +9 -0
- data/Gemfile.lock +40 -34
- data/README.md +4 -1
- data/lib/jupyter_on_rails/kernel.rb +12 -0
- data/lib/jupyter_on_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2e9d74610e71debbdc6c91f031fa391a2b8e0f3172674cfa73e9cba0cc2742c
|
4
|
+
data.tar.gz: '08ecc7606a5c011eca37e649838dfc98d3d66c76592aea490ec451e44947d382'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d2fc76e92884c5b85dd4feff960665385b460cc8a1f6d9d9fada4b8edd2362eb8f90e702d68c43fb5f3c42168eef37d1705d2e65d1c116986eca61d3515f2a8
|
7
|
+
data.tar.gz: 04d22ff64f23ac0c95045949489d5dce4bec3f6fc278ccebcc824b8ebf96e3163bc4bbc1201e497f7d6ce6a3b444d34b1d33c660aef0e4e2c29afe7be889fccb
|
data/.github/workflows/ruby.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
Gemspec/RequiredRubyVersion:
|
2
|
+
Enabled: false
|
3
|
+
|
1
4
|
Metrics/LineLength:
|
2
5
|
Max: 160
|
3
6
|
|
@@ -13,6 +16,12 @@ Metrics/AbcSize:
|
|
13
16
|
Metrics/MethodLength:
|
14
17
|
Max: 60
|
15
18
|
|
19
|
+
Metrics/PerceivedComplexity:
|
20
|
+
Max: 20
|
21
|
+
|
22
|
+
Metrics/CyclomaticComplexity:
|
23
|
+
Max: 20
|
24
|
+
|
16
25
|
Style/MultilineTernaryOperator:
|
17
26
|
Enabled: false
|
18
27
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
jupyter_on_rails (0.
|
4
|
+
jupyter_on_rails (0.8.0)
|
5
5
|
daru
|
6
6
|
iruby
|
7
7
|
railties
|
@@ -9,20 +9,20 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionpack (6.0.3)
|
13
|
-
actionview (= 6.0.3)
|
14
|
-
activesupport (= 6.0.3)
|
12
|
+
actionpack (6.0.3.3)
|
13
|
+
actionview (= 6.0.3.3)
|
14
|
+
activesupport (= 6.0.3.3)
|
15
15
|
rack (~> 2.0, >= 2.0.8)
|
16
16
|
rack-test (>= 0.6.3)
|
17
17
|
rails-dom-testing (~> 2.0)
|
18
18
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
19
|
-
actionview (6.0.3)
|
20
|
-
activesupport (= 6.0.3)
|
19
|
+
actionview (6.0.3.3)
|
20
|
+
activesupport (= 6.0.3.3)
|
21
21
|
builder (~> 3.1)
|
22
22
|
erubi (~> 1.4)
|
23
23
|
rails-dom-testing (~> 2.0)
|
24
24
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
25
|
-
activesupport (6.0.3)
|
25
|
+
activesupport (6.0.3.3)
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
27
|
i18n (>= 0.7, < 2)
|
28
28
|
minitest (~> 5.1)
|
@@ -30,18 +30,17 @@ GEM
|
|
30
30
|
zeitwerk (~> 2.2, >= 2.2.2)
|
31
31
|
addressable (2.7.0)
|
32
32
|
public_suffix (>= 2.0.2, < 5.0)
|
33
|
-
ast (2.4.
|
34
|
-
backports (3.
|
33
|
+
ast (2.4.1)
|
34
|
+
backports (3.20.1)
|
35
35
|
bond (0.5.1)
|
36
36
|
builder (3.2.4)
|
37
37
|
bump (0.9.0)
|
38
|
-
concurrent-ruby (1.1.
|
38
|
+
concurrent-ruby (1.1.7)
|
39
39
|
crass (1.0.6)
|
40
|
-
daru (0.
|
41
|
-
|
42
|
-
packable (~> 1.3.9)
|
40
|
+
daru (0.3)
|
41
|
+
packable (~> 1.3.13)
|
43
42
|
data_uri (0.1.0)
|
44
|
-
erubi (1.
|
43
|
+
erubi (1.10.0)
|
45
44
|
faraday (1.0.1)
|
46
45
|
multipart-post (>= 1.2, < 3)
|
47
46
|
faraday-http-cache (2.2.0)
|
@@ -54,34 +53,36 @@ GEM
|
|
54
53
|
rainbow (>= 2.2.1)
|
55
54
|
rake (>= 10.0)
|
56
55
|
retriable (~> 3.0)
|
57
|
-
i18n (1.8.
|
56
|
+
i18n (1.8.5)
|
58
57
|
concurrent-ruby (~> 1.0)
|
59
58
|
iruby (0.4.0)
|
60
59
|
bond (~> 0.5)
|
61
60
|
data_uri (~> 0.1)
|
62
61
|
mimemagic (~> 0.3)
|
63
62
|
multi_json (~> 1.11)
|
64
|
-
loofah (2.
|
63
|
+
loofah (2.8.0)
|
65
64
|
crass (~> 1.0.2)
|
66
65
|
nokogiri (>= 1.5.9)
|
67
66
|
method_source (1.0.0)
|
68
67
|
mimemagic (0.3.5)
|
69
|
-
mini_portile2 (2.
|
70
|
-
minitest (5.14.
|
68
|
+
mini_portile2 (2.5.0)
|
69
|
+
minitest (5.14.2)
|
71
70
|
multi_json (1.14.1)
|
72
71
|
multipart-post (2.1.1)
|
73
|
-
nokogiri (1.
|
74
|
-
mini_portile2 (~> 2.
|
72
|
+
nokogiri (1.11.1)
|
73
|
+
mini_portile2 (~> 2.5.0)
|
74
|
+
racc (~> 1.4)
|
75
75
|
octokit (4.18.0)
|
76
76
|
faraday (>= 0.9)
|
77
77
|
sawyer (~> 0.8.0, >= 0.5.3)
|
78
|
-
packable (1.3.
|
78
|
+
packable (1.3.14)
|
79
79
|
backports
|
80
|
-
parallel (1.
|
81
|
-
parser (
|
82
|
-
ast (~> 2.4.
|
80
|
+
parallel (1.20.1)
|
81
|
+
parser (3.0.0.0)
|
82
|
+
ast (~> 2.4.1)
|
83
83
|
public_suffix (4.0.5)
|
84
|
-
|
84
|
+
racc (1.5.2)
|
85
|
+
rack (2.2.3)
|
85
86
|
rack-test (1.1.0)
|
86
87
|
rack (>= 1.0, < 3)
|
87
88
|
rails-dom-testing (2.0.3)
|
@@ -89,24 +90,29 @@ GEM
|
|
89
90
|
nokogiri (>= 1.6)
|
90
91
|
rails-html-sanitizer (1.3.0)
|
91
92
|
loofah (~> 2.3)
|
92
|
-
railties (6.0.3)
|
93
|
-
actionpack (= 6.0.3)
|
94
|
-
activesupport (= 6.0.3)
|
93
|
+
railties (6.0.3.3)
|
94
|
+
actionpack (= 6.0.3.3)
|
95
|
+
activesupport (= 6.0.3.3)
|
95
96
|
method_source
|
96
97
|
rake (>= 0.8.7)
|
97
98
|
thor (>= 0.20.3, < 2.0)
|
98
99
|
rainbow (3.0.0)
|
99
100
|
rake (13.0.1)
|
101
|
+
regexp_parser (2.0.3)
|
100
102
|
retriable (3.1.2)
|
101
103
|
rexml (3.2.4)
|
102
|
-
rubocop (
|
104
|
+
rubocop (1.8.0)
|
103
105
|
parallel (~> 1.10)
|
104
|
-
parser (>=
|
106
|
+
parser (>= 3.0.0.0)
|
105
107
|
rainbow (>= 2.2.2, < 4.0)
|
108
|
+
regexp_parser (>= 1.8, < 3.0)
|
106
109
|
rexml
|
110
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
107
111
|
ruby-progressbar (~> 1.7)
|
108
|
-
unicode-display_width (>= 1.4.0, <
|
109
|
-
|
112
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
113
|
+
rubocop-ast (1.4.0)
|
114
|
+
parser (>= 2.7.1.5)
|
115
|
+
ruby-progressbar (1.11.0)
|
110
116
|
sawyer (0.8.2)
|
111
117
|
addressable (>= 2.3.5)
|
112
118
|
faraday (> 0.8, < 2.0)
|
@@ -114,8 +120,8 @@ GEM
|
|
114
120
|
thread_safe (0.3.6)
|
115
121
|
tzinfo (1.2.7)
|
116
122
|
thread_safe (~> 0.1)
|
117
|
-
unicode-display_width (
|
118
|
-
zeitwerk (2.
|
123
|
+
unicode-display_width (2.0.0)
|
124
|
+
zeitwerk (2.4.0)
|
119
125
|
|
120
126
|
PLATFORMS
|
121
127
|
ruby
|
data/README.md
CHANGED
@@ -14,7 +14,10 @@ managing the jupyter configuration installed in user global area (the iruby kern
|
|
14
14
|
|
15
15
|
With this gem, these awkwardness is to solved by following instruments:
|
16
16
|
* `rake jupyter:notebook` Railtie command which invokes jupyter at your project root, and
|
17
|
-
*
|
17
|
+
* This rake task automatically creates two `iruby` kernels to load your application in Jupyter:
|
18
|
+
* one for normal operation
|
19
|
+
* one for sandbox mode in which everything you do is wrapped in a database transaction that is rolled back when the
|
20
|
+
kernel exits (equivalent to `rails console --sandbox`)
|
18
21
|
|
19
22
|
|
20
23
|
## Prerequisites
|
@@ -26,6 +26,18 @@ module JupyterOnRails
|
|
26
26
|
|
27
27
|
require 'iruby'
|
28
28
|
IRuby::Kernel.instance_eval { prepend JupyterOnRails::IRubyKernelExtention }
|
29
|
+
IRuby::Display::Registry.instance_eval do
|
30
|
+
match do |obj|
|
31
|
+
obj.is_a?(ActiveRecord::Relation) ||
|
32
|
+
obj.is_a?(::Class) && obj < ActiveRecord::Base && !obj.abstract_class
|
33
|
+
end
|
34
|
+
priority 100
|
35
|
+
format 'text/html' do |obj|
|
36
|
+
n = 10
|
37
|
+
puts "finding top #{n}"
|
38
|
+
obj.limit(n).to_df.to_html
|
39
|
+
end
|
40
|
+
end
|
29
41
|
end
|
30
42
|
end
|
31
43
|
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.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuki INOUE
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bump
|