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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4dd954da8ae0ebe5bad32d7b98acb1dbde79b0f3b6bcd837d019f11085b50f8
4
- data.tar.gz: 992c4ab71f53ba0b59752558e7cbaf932de72e9d6db4ac38a4ab5bef595b655c
3
+ metadata.gz: f2e9d74610e71debbdc6c91f031fa391a2b8e0f3172674cfa73e9cba0cc2742c
4
+ data.tar.gz: '08ecc7606a5c011eca37e649838dfc98d3d66c76592aea490ec451e44947d382'
5
5
  SHA512:
6
- metadata.gz: 48132a0169aad90d07c55297efe02ff154f0883be55efb47380578c3b1c7c953f18b4ab8dd2ad9325af556ce8b92134e2733e7f14472a0d0e29ea6b763c3868c
7
- data.tar.gz: 516169086976ad9770c374f0fb481f2b12c6c8cd04b5688e6752f7c72110bd76dd3b459be1d64915829582e1c701d1d0633ae6a726125db296ceaa1731938215
6
+ metadata.gz: 4d2fc76e92884c5b85dd4feff960665385b460cc8a1f6d9d9fada4b8edd2362eb8f90e702d68c43fb5f3c42168eef37d1705d2e65d1c116986eca61d3515f2a8
7
+ data.tar.gz: 04d22ff64f23ac0c95045949489d5dce4bec3f6fc278ccebcc824b8ebf96e3163bc4bbc1201e497f7d6ce6a3b444d34b1d33c660aef0e4e2c29afe7be889fccb
@@ -14,7 +14,7 @@ jobs:
14
14
  - name: Set up Ruby
15
15
  uses: actions/setup-ruby@v1
16
16
  with:
17
- ruby-version: 2.7.1
17
+ ruby-version: 2.7.2
18
18
  # https://github.com/actions/cache/blob/master/examples.md#ruby---bundler
19
19
  - uses: actions/cache@v1
20
20
  with:
@@ -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
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jupyter_on_rails (0.7.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.0)
34
- backports (3.17.1)
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.6)
38
+ concurrent-ruby (1.1.7)
39
39
  crass (1.0.6)
40
- daru (0.2.2)
41
- backports
42
- packable (~> 1.3.9)
40
+ daru (0.3)
41
+ packable (~> 1.3.13)
43
42
  data_uri (0.1.0)
44
- erubi (1.9.0)
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.2)
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.5.0)
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.4.0)
70
- minitest (5.14.0)
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.10.9)
74
- mini_portile2 (~> 2.4.0)
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.13)
78
+ packable (1.3.14)
79
79
  backports
80
- parallel (1.19.1)
81
- parser (2.7.1.2)
82
- ast (~> 2.4.0)
80
+ parallel (1.20.1)
81
+ parser (3.0.0.0)
82
+ ast (~> 2.4.1)
83
83
  public_suffix (4.0.5)
84
- rack (2.2.2)
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 (0.83.0)
104
+ rubocop (1.8.0)
103
105
  parallel (~> 1.10)
104
- parser (>= 2.7.0.1)
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, < 2.0)
109
- ruby-progressbar (1.10.1)
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 (1.7.0)
118
- zeitwerk (2.3.0)
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
- * The rails kernel dynamically defined by the rake task which automatically loads your Rails application.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JupyterOnRails
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.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.7.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: 2020-05-13 00:00:00.000000000 Z
11
+ date: 2021-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bump