workbook_rails 0.2.0 → 0.2.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/Gemfile +8 -7
- data/Gemfile.lock +206 -172
- data/README.md +3 -3
- data/Rakefile +7 -19
- data/lib/tasks/workbook_rails_tasks.rake +2 -0
- data/lib/workbook_rails/action_controller.rb +15 -10
- data/lib/workbook_rails/engine.rb +4 -4
- data/lib/workbook_rails/template_handler.rb +6 -5
- data/lib/workbook_rails/version.rb +3 -1
- data/lib/workbook_rails.rb +3 -2
- data/spec/ci.rb +5 -1
- data/spec/dummy/Rakefile +3 -1
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/controllers/home_controller.rb +14 -16
- data/spec/dummy/app/controllers/likes_controller.rb +3 -1
- data/spec/dummy/app/controllers/users_controller.rb +4 -2
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/notifier.rb +5 -4
- data/spec/dummy/app/models/like.rb +2 -0
- data/spec/dummy/app/models/user.rb +2 -0
- data/spec/dummy/bin/bundle +3 -1
- data/spec/dummy/bin/rails +3 -1
- data/spec/dummy/bin/rake +2 -0
- data/spec/dummy/config/application.rb +9 -8
- data/spec/dummy/config/boot.rb +4 -2
- data/spec/dummy/config/environment.rb +3 -1
- data/spec/dummy/config/environments/development.rb +2 -0
- data/spec/dummy/config/environments/production.rb +2 -0
- data/spec/dummy/config/environments/test.rb +6 -4
- data/spec/dummy/config/initializers/backtrace_silencers.rb +2 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -1
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +2 -0
- data/spec/dummy/config/initializers/inflections.rb +2 -0
- data/spec/dummy/config/initializers/mime_types.rb +2 -0
- data/spec/dummy/config/initializers/secret_token.rb +3 -1
- data/spec/dummy/config/initializers/session_store.rb +2 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +2 -0
- data/spec/dummy/config/routes.rb +13 -11
- data/spec/dummy/config.ru +3 -1
- data/spec/dummy/db/migrate/20120717192452_create_users.rb +2 -0
- data/spec/dummy/db/migrate/20121206210955_create_likes.rb +2 -0
- data/spec/dummy/db/schema.rb +1 -2
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +6916 -16248
- data/spec/spec_helper.rb +14 -14
- data/spec/template_handler_spec.rb +12 -15
- data/spec/test_7.2.sh +6 -0
- data/spec/test_8.0.sh +6 -0
- data/spec/test_8.1.sh +6 -0
- data/spec/test_all_rails.sh +10 -4
- data/spec/workbook_mailer_spec.rb +9 -4
- data/spec/workbook_renderer_spec.rb +10 -10
- data/spec/workbook_request_spec.rb +60 -49
- metadata +13 -20
- data/spec/dummy/log/development.log +0 -24
- data/spec/test_6.0.sh +0 -4
- data/spec/test_6.1.sh +0 -4
- data/spec/test_7.0.sh +0 -4
- data/spec/test_7.1.sh +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59888c905d996c59225f4f4f6b20ec16f0eb849cd30326f8f8c5f217eb0a766c
|
|
4
|
+
data.tar.gz: a94ef7862f9e37d3967c3312672d740e9b819673d2f9cd56b256457b353f4b61
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2918be57d144c3d6c219f2132768f5abe7eb932c2d6fcc260b13a1df71ccae024cff238911cd184cbe3318a581205cb9dad6f92f8dc6dc5d0d2092d2f0842d24
|
|
7
|
+
data.tar.gz: b5ed51f1aeb8922eeeeb76be199a31fed68b6b1eb4de3dd2921aeb69fc32d964952a395d5ddf92d14acd3e58308b7903f0e3320ce5af3b452499d1dbd2a46622
|
data/Gemfile
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source 'https://rubygems.org'
|
|
2
4
|
|
|
3
5
|
# Declare your gem's dependencies in axlsx_rails.gemspec.
|
|
4
6
|
# Bundler will treat runtime dependencies like base dependencies, and
|
|
5
7
|
# development dependencies will be added by default to the :development group.
|
|
6
8
|
gemspec
|
|
7
9
|
|
|
8
|
-
gem 'rails',
|
|
10
|
+
gem 'rails', '~> 8.1.0'
|
|
9
11
|
gem 'responders', '~> 3.0'
|
|
10
12
|
|
|
11
13
|
# Declare any dependencies that are still in development here instead of in
|
|
@@ -17,9 +19,8 @@ gem 'responders', '~> 3.0'
|
|
|
17
19
|
# gem 'pry-debugger'
|
|
18
20
|
group :test do
|
|
19
21
|
gem 'capybara', '~> 2.1'
|
|
20
|
-
gem '
|
|
21
|
-
gem '
|
|
22
|
-
gem
|
|
23
|
-
gem
|
|
24
|
-
gem "coveralls"
|
|
22
|
+
gem 'rspec-rails'
|
|
23
|
+
gem 'simplecov', '>= 0.22', require: false
|
|
24
|
+
gem 'simplecov_json_formatter'
|
|
25
|
+
gem 'sqlite3'
|
|
25
26
|
end
|
data/Gemfile.lock
CHANGED
|
@@ -1,81 +1,92 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
workbook_rails (0.2.
|
|
5
|
-
actionpack (>=
|
|
4
|
+
workbook_rails (0.2.1)
|
|
5
|
+
actionpack (>= 7.2)
|
|
6
6
|
workbook (>= 0.4.10)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
action_text-trix (2.1.19)
|
|
12
|
+
railties
|
|
13
|
+
actioncable (8.1.4.1)
|
|
14
|
+
actionpack (= 8.1.4.1)
|
|
15
|
+
activesupport (= 8.1.4.1)
|
|
14
16
|
nio4r (~> 2.0)
|
|
15
17
|
websocket-driver (>= 0.6.1)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
zeitwerk (~> 2.6)
|
|
19
|
+
actionmailbox (8.1.4.1)
|
|
20
|
+
actionpack (= 8.1.4.1)
|
|
21
|
+
activejob (= 8.1.4.1)
|
|
22
|
+
activerecord (= 8.1.4.1)
|
|
23
|
+
activestorage (= 8.1.4.1)
|
|
24
|
+
activesupport (= 8.1.4.1)
|
|
25
|
+
mail (>= 2.8.0)
|
|
26
|
+
actionmailer (8.1.4.1)
|
|
27
|
+
actionpack (= 8.1.4.1)
|
|
28
|
+
actionview (= 8.1.4.1)
|
|
29
|
+
activejob (= 8.1.4.1)
|
|
30
|
+
activesupport (= 8.1.4.1)
|
|
31
|
+
mail (>= 2.8.0)
|
|
32
|
+
rails-dom-testing (~> 2.2)
|
|
33
|
+
actionpack (8.1.4.1)
|
|
34
|
+
actionview (= 8.1.4.1)
|
|
35
|
+
activesupport (= 8.1.4.1)
|
|
36
|
+
nokogiri (>= 1.8.5)
|
|
37
|
+
rack (>= 2.2.4)
|
|
38
|
+
rack-session (>= 1.0.1)
|
|
34
39
|
rack-test (>= 0.6.3)
|
|
35
|
-
rails-dom-testing (~> 2.
|
|
36
|
-
rails-html-sanitizer (~> 1.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
rails-dom-testing (~> 2.2)
|
|
41
|
+
rails-html-sanitizer (~> 1.6)
|
|
42
|
+
useragent (~> 0.16)
|
|
43
|
+
actiontext (8.1.4.1)
|
|
44
|
+
action_text-trix (~> 2.1.15)
|
|
45
|
+
actionpack (= 8.1.4.1)
|
|
46
|
+
activerecord (= 8.1.4.1)
|
|
47
|
+
activestorage (= 8.1.4.1)
|
|
48
|
+
activesupport (= 8.1.4.1)
|
|
49
|
+
globalid (>= 0.6.0)
|
|
42
50
|
nokogiri (>= 1.8.5)
|
|
43
|
-
actionview (
|
|
44
|
-
activesupport (=
|
|
51
|
+
actionview (8.1.4.1)
|
|
52
|
+
activesupport (= 8.1.4.1)
|
|
45
53
|
builder (~> 3.1)
|
|
46
|
-
erubi (~> 1.
|
|
47
|
-
rails-dom-testing (~> 2.
|
|
48
|
-
rails-html-sanitizer (~> 1.
|
|
49
|
-
activejob (
|
|
50
|
-
activesupport (=
|
|
54
|
+
erubi (~> 1.11)
|
|
55
|
+
rails-dom-testing (~> 2.2)
|
|
56
|
+
rails-html-sanitizer (~> 1.6, >= 1.7.2)
|
|
57
|
+
activejob (8.1.4.1)
|
|
58
|
+
activesupport (= 8.1.4.1)
|
|
51
59
|
globalid (>= 0.3.6)
|
|
52
|
-
activemodel (
|
|
53
|
-
activesupport (=
|
|
54
|
-
activerecord (
|
|
55
|
-
activemodel (=
|
|
56
|
-
activesupport (=
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
activemodel (8.1.4.1)
|
|
61
|
+
activesupport (= 8.1.4.1)
|
|
62
|
+
activerecord (8.1.4.1)
|
|
63
|
+
activemodel (= 8.1.4.1)
|
|
64
|
+
activesupport (= 8.1.4.1)
|
|
65
|
+
timeout (>= 0.4.0)
|
|
66
|
+
activestorage (8.1.4.1)
|
|
67
|
+
actionpack (= 8.1.4.1)
|
|
68
|
+
activejob (= 8.1.4.1)
|
|
69
|
+
activerecord (= 8.1.4.1)
|
|
70
|
+
activesupport (= 8.1.4.1)
|
|
62
71
|
marcel (~> 1.0)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
activesupport (8.1.4.1)
|
|
73
|
+
base64
|
|
74
|
+
bigdecimal
|
|
75
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
76
|
+
connection_pool (>= 2.2.5)
|
|
77
|
+
drb
|
|
66
78
|
i18n (>= 1.6, < 2)
|
|
79
|
+
json
|
|
80
|
+
logger (>= 1.4.2)
|
|
67
81
|
minitest (>= 5.1)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
rubyzip (~> 1.2, >= 1.2.1)
|
|
77
|
-
bigdecimal (3.1.8)
|
|
78
|
-
builder (3.2.4)
|
|
82
|
+
securerandom (>= 0.3)
|
|
83
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
84
|
+
uri (>= 0.13.1)
|
|
85
|
+
addressable (2.10.0)
|
|
86
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
87
|
+
base64 (0.3.0)
|
|
88
|
+
bigdecimal (4.1.3)
|
|
89
|
+
builder (3.3.0)
|
|
79
90
|
capybara (2.18.0)
|
|
80
91
|
addressable
|
|
81
92
|
mini_mime (>= 0.1.3)
|
|
@@ -83,147 +94,171 @@ GEM
|
|
|
83
94
|
rack (>= 1.0.0)
|
|
84
95
|
rack-test (>= 0.5.4)
|
|
85
96
|
xpath (>= 2.0, < 4.0)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
erubi (1.
|
|
100
|
-
globalid (1.
|
|
97
|
+
caxlsx (4.5.0)
|
|
98
|
+
htmlentities (~> 4.3, >= 4.3.4)
|
|
99
|
+
marcel (~> 1.0)
|
|
100
|
+
nokogiri (~> 1.10, >= 1.10.4)
|
|
101
|
+
rubyzip (>= 2.4, < 4)
|
|
102
|
+
concurrent-ruby (1.3.8)
|
|
103
|
+
connection_pool (3.0.3)
|
|
104
|
+
crass (1.0.8)
|
|
105
|
+
csv (3.3.7)
|
|
106
|
+
date (3.6.0)
|
|
107
|
+
diff-lcs (1.6.2)
|
|
108
|
+
drb (2.2.3)
|
|
109
|
+
erb (6.0.7)
|
|
110
|
+
erubi (1.13.1)
|
|
111
|
+
globalid (1.4.0)
|
|
101
112
|
activesupport (>= 6.1)
|
|
102
|
-
htmlentities (4.
|
|
103
|
-
i18n (1.
|
|
113
|
+
htmlentities (4.4.2)
|
|
114
|
+
i18n (1.15.2)
|
|
104
115
|
concurrent-ruby (~> 1.0)
|
|
105
|
-
|
|
106
|
-
|
|
116
|
+
io-console (0.9.5)
|
|
117
|
+
irb (1.19.0)
|
|
118
|
+
pp (>= 0.6.0)
|
|
119
|
+
prism (>= 1.3.0)
|
|
120
|
+
rdoc (>= 4.0.0)
|
|
121
|
+
reline (>= 0.4.2)
|
|
122
|
+
json (2.21.2)
|
|
123
|
+
logger (1.7.0)
|
|
124
|
+
loofah (2.25.3)
|
|
107
125
|
crass (~> 1.0.2)
|
|
108
|
-
nokogiri (>= 1.
|
|
109
|
-
mail (2.
|
|
126
|
+
nokogiri (>= 1.19.5)
|
|
127
|
+
mail (2.9.1)
|
|
128
|
+
logger
|
|
110
129
|
mini_mime (>= 0.1.1)
|
|
111
130
|
net-imap
|
|
112
131
|
net-pop
|
|
113
132
|
net-smtp
|
|
114
|
-
marcel (1.
|
|
115
|
-
method_source (1.1.0)
|
|
116
|
-
mimemagic (0.4.3)
|
|
117
|
-
nokogiri (~> 1)
|
|
118
|
-
rake
|
|
133
|
+
marcel (1.2.1)
|
|
119
134
|
mini_mime (1.1.5)
|
|
120
|
-
mini_portile2 (2.8.
|
|
121
|
-
minitest (
|
|
122
|
-
|
|
135
|
+
mini_portile2 (2.8.9)
|
|
136
|
+
minitest (6.1.0)
|
|
137
|
+
drb (~> 2.0)
|
|
138
|
+
prism (>= 1.5, < 3)
|
|
139
|
+
net-imap (0.6.8)
|
|
123
140
|
date
|
|
124
141
|
net-protocol
|
|
125
142
|
net-pop (0.1.2)
|
|
126
143
|
net-protocol
|
|
127
|
-
net-protocol (0.
|
|
144
|
+
net-protocol (0.4.0)
|
|
128
145
|
timeout
|
|
129
|
-
net-smtp (0.5.
|
|
146
|
+
net-smtp (0.5.2)
|
|
130
147
|
net-protocol
|
|
131
|
-
nio4r (2.7.
|
|
132
|
-
nokogiri (1.
|
|
148
|
+
nio4r (2.7.5)
|
|
149
|
+
nokogiri (1.19.7)
|
|
133
150
|
mini_portile2 (~> 2.8.2)
|
|
134
151
|
racc (~> 1.4)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
152
|
+
pp (0.6.4)
|
|
153
|
+
prettyprint
|
|
154
|
+
prettyprint (0.2.1)
|
|
155
|
+
prism (2.1.0)
|
|
156
|
+
public_suffix (7.0.5)
|
|
157
|
+
racc (1.8.1)
|
|
158
|
+
rack (3.2.9)
|
|
159
|
+
rack-session (2.1.2)
|
|
160
|
+
base64 (>= 0.1.0)
|
|
161
|
+
rack (>= 3.0.0)
|
|
162
|
+
rack-test (2.3.0)
|
|
139
163
|
rack (>= 1.3)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
164
|
+
rackup (2.3.1)
|
|
165
|
+
rack (>= 3)
|
|
166
|
+
rails (8.1.4.1)
|
|
167
|
+
actioncable (= 8.1.4.1)
|
|
168
|
+
actionmailbox (= 8.1.4.1)
|
|
169
|
+
actionmailer (= 8.1.4.1)
|
|
170
|
+
actionpack (= 8.1.4.1)
|
|
171
|
+
actiontext (= 8.1.4.1)
|
|
172
|
+
actionview (= 8.1.4.1)
|
|
173
|
+
activejob (= 8.1.4.1)
|
|
174
|
+
activemodel (= 8.1.4.1)
|
|
175
|
+
activerecord (= 8.1.4.1)
|
|
176
|
+
activestorage (= 8.1.4.1)
|
|
177
|
+
activesupport (= 8.1.4.1)
|
|
152
178
|
bundler (>= 1.15.0)
|
|
153
|
-
railties (=
|
|
154
|
-
|
|
155
|
-
rails-dom-testing (2.2.0)
|
|
179
|
+
railties (= 8.1.4.1)
|
|
180
|
+
rails-dom-testing (2.3.0)
|
|
156
181
|
activesupport (>= 5.0.0)
|
|
157
182
|
minitest
|
|
158
183
|
nokogiri (>= 1.6)
|
|
159
|
-
rails-html-sanitizer (1.
|
|
160
|
-
loofah (~> 2.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
184
|
+
rails-html-sanitizer (1.7.2)
|
|
185
|
+
loofah (~> 2.25, >= 2.25.3)
|
|
186
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
187
|
+
railties (8.1.4.1)
|
|
188
|
+
actionpack (= 8.1.4.1)
|
|
189
|
+
activesupport (= 8.1.4.1)
|
|
190
|
+
irb (~> 1.13)
|
|
191
|
+
rackup (>= 1.0.0)
|
|
165
192
|
rake (>= 12.2)
|
|
166
|
-
thor (~> 1.0)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
193
|
+
thor (~> 1.0, >= 1.2.2)
|
|
194
|
+
tsort (>= 0.2)
|
|
195
|
+
zeitwerk (~> 2.6)
|
|
196
|
+
rake (13.4.2)
|
|
197
|
+
rbs (4.2.0)
|
|
198
|
+
logger
|
|
199
|
+
prism (>= 1.6.0)
|
|
200
|
+
tsort
|
|
201
|
+
rchardet (1.10.2)
|
|
202
|
+
rdoc (8.1.0)
|
|
203
|
+
erb
|
|
204
|
+
prism (>= 1.6.0)
|
|
205
|
+
rbs (>= 4.0.0)
|
|
206
|
+
tsort
|
|
207
|
+
reline (0.7.0)
|
|
208
|
+
io-console (~> 0.5)
|
|
209
|
+
responders (3.2.1)
|
|
210
|
+
actionpack (>= 7.0)
|
|
211
|
+
railties (>= 7.0)
|
|
212
|
+
rspec-core (3.13.7)
|
|
173
213
|
rspec-support (~> 3.13.0)
|
|
174
|
-
rspec-expectations (3.13.
|
|
214
|
+
rspec-expectations (3.13.6)
|
|
175
215
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
176
216
|
rspec-support (~> 3.13.0)
|
|
177
|
-
rspec-mocks (3.13.
|
|
217
|
+
rspec-mocks (3.13.9)
|
|
178
218
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
179
219
|
rspec-support (~> 3.13.0)
|
|
180
|
-
rspec-rails (
|
|
181
|
-
actionpack (>=
|
|
182
|
-
activesupport (>=
|
|
183
|
-
railties (>=
|
|
184
|
-
rspec-core (
|
|
185
|
-
rspec-expectations (
|
|
186
|
-
rspec-mocks (
|
|
187
|
-
rspec-support (
|
|
188
|
-
rspec-support (3.13.
|
|
220
|
+
rspec-rails (8.1.0)
|
|
221
|
+
actionpack (>= 7.2)
|
|
222
|
+
activesupport (>= 7.2)
|
|
223
|
+
railties (>= 7.2)
|
|
224
|
+
rspec-core (>= 3.13.0, < 5.0.0)
|
|
225
|
+
rspec-expectations (>= 3.13.0, < 5.0.0)
|
|
226
|
+
rspec-mocks (>= 3.13.0, < 5.0.0)
|
|
227
|
+
rspec-support (>= 3.13.0, < 5.0.0)
|
|
228
|
+
rspec-support (3.13.8)
|
|
189
229
|
ruby-ole (1.2.13.1)
|
|
190
|
-
rubyzip (
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
simplecov-html (0.10.2)
|
|
196
|
-
spreadsheet (1.3.1)
|
|
230
|
+
rubyzip (3.7.0)
|
|
231
|
+
securerandom (0.4.1)
|
|
232
|
+
simplecov (1.3.2)
|
|
233
|
+
simplecov_json_formatter (0.1.4)
|
|
234
|
+
spreadsheet (1.3.5)
|
|
197
235
|
bigdecimal
|
|
236
|
+
logger
|
|
198
237
|
ruby-ole
|
|
199
|
-
|
|
200
|
-
concurrent-ruby (~> 1.0)
|
|
201
|
-
rack (>= 2.2.4, < 4)
|
|
202
|
-
sprockets-rails (3.4.2)
|
|
203
|
-
actionpack (>= 5.2)
|
|
204
|
-
activesupport (>= 5.2)
|
|
205
|
-
sprockets (>= 3.0.0)
|
|
206
|
-
sqlite3 (1.6.9)
|
|
238
|
+
sqlite3 (2.10.2)
|
|
207
239
|
mini_portile2 (~> 2.8.0)
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
timeout (0.4.1)
|
|
212
|
-
tins (1.16.3)
|
|
240
|
+
thor (1.5.0)
|
|
241
|
+
timeout (0.6.1)
|
|
242
|
+
tsort (0.2.0)
|
|
213
243
|
tzinfo (2.0.6)
|
|
214
244
|
concurrent-ruby (~> 1.0)
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
websocket-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
245
|
+
uri (1.1.2)
|
|
246
|
+
useragent (0.16.11)
|
|
247
|
+
websocket-driver (0.9.0)
|
|
248
|
+
base64
|
|
249
|
+
websocket-extensions (>= 0.2.0)
|
|
250
|
+
websocket-extensions (0.2.0)
|
|
251
|
+
workbook (0.9.1)
|
|
252
|
+
caxlsx (> 3.0)
|
|
253
|
+
csv (> 3.0.0)
|
|
254
|
+
json (> 2.3)
|
|
255
|
+
nokogiri (> 1.10)
|
|
256
|
+
rchardet (>= 1.8.0)
|
|
257
|
+
rubyzip (>= 1.2.1, > 1.2)
|
|
258
|
+
spreadsheet (> 1.2)
|
|
224
259
|
xpath (3.2.0)
|
|
225
260
|
nokogiri (~> 1.8)
|
|
226
|
-
zeitwerk (2.
|
|
261
|
+
zeitwerk (2.8.3)
|
|
227
262
|
|
|
228
263
|
PLATFORMS
|
|
229
264
|
ruby
|
|
@@ -231,15 +266,14 @@ PLATFORMS
|
|
|
231
266
|
DEPENDENCIES
|
|
232
267
|
bundler
|
|
233
268
|
capybara (~> 2.1)
|
|
234
|
-
|
|
235
|
-
coveralls
|
|
236
|
-
rails (~> 6.1.0)
|
|
269
|
+
rails (~> 8.1.0)
|
|
237
270
|
rake
|
|
238
271
|
responders (~> 3.0)
|
|
239
272
|
rspec-rails
|
|
240
|
-
simplecov
|
|
273
|
+
simplecov (>= 0.22)
|
|
274
|
+
simplecov_json_formatter
|
|
241
275
|
sqlite3
|
|
242
276
|
workbook_rails!
|
|
243
277
|
|
|
244
278
|
BUNDLED WITH
|
|
245
|
-
|
|
279
|
+
4.1.0
|
data/README.md
CHANGED
|
@@ -4,8 +4,7 @@ Workbook-Rails — Workbook templates for Rails views
|
|
|
4
4
|
[](http://badge.fury.io/rb/workbook_rails)
|
|
6
6
|
[](https://github.com/scambra/workbook_rails/actions/workflows/ruby.yml)
|
|
7
|
-
[
|
|
8
|
-
[](https://coveralls.io/github/scambra/workbook_rails?branch=master)
|
|
7
|
+
[Code quality and coverage on Qlty](https://qlty.sh/gh/scambra/projects/workbook_rails)
|
|
9
8
|
[](https://opensource.org/licenses/MIT)
|
|
10
9
|
|
|
11
10
|
|
|
@@ -19,7 +18,8 @@ gem 'workbook_rails'
|
|
|
19
18
|
|
|
20
19
|
## Requirements
|
|
21
20
|
|
|
22
|
-
*
|
|
21
|
+
* Ruby 3.2 or newer
|
|
22
|
+
* Rails >= 7.2 and <= 8.1 (tested)
|
|
23
23
|
* **Workbook 0.4.16 requires Axlsx 2.0.1, which requires rubyzip 1.0.0**
|
|
24
24
|
* You must use `render_to_string` to render a mail attachment.
|
|
25
25
|
|
data/Rakefile
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env rake
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
begin
|
|
8
|
-
require 'rdoc/task'
|
|
9
|
-
rescue LoadError
|
|
10
|
-
require 'rdoc/rdoc'
|
|
11
|
-
require 'rake/rdoctask'
|
|
12
|
-
RDoc::Task = Rake::RDocTask
|
|
13
|
-
end
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require 'bundler/setup'
|
|
5
|
+
require 'rdoc/task'
|
|
6
|
+
require 'rspec/core/rake_task'
|
|
14
7
|
|
|
15
8
|
RDoc::Task.new(:rdoc) do |rdoc|
|
|
16
9
|
rdoc.rdoc_dir = 'rdoc'
|
|
@@ -20,13 +13,8 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
|
20
13
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
21
14
|
end
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
require "rspec/core/rake_task"
|
|
25
|
-
RSpec::Core::RakeTask.new('spec')
|
|
26
|
-
rescue LoadError
|
|
27
|
-
end
|
|
16
|
+
RSpec::Core::RakeTask.new('spec')
|
|
28
17
|
|
|
29
|
-
task :
|
|
18
|
+
task default: :spec
|
|
30
19
|
|
|
31
20
|
Bundler::GemHelper.install_tasks
|
|
32
|
-
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
#
|
|
2
4
|
# You can always specify a template:
|
|
3
5
|
#
|
|
@@ -15,8 +17,9 @@
|
|
|
15
17
|
#
|
|
16
18
|
WorkbookRails::FORMATS.each do |format|
|
|
17
19
|
ActionController::Renderers.add format do |filename, options|
|
|
18
|
-
if options[:template] == action_name
|
|
19
|
-
options[:template] = filename.gsub(
|
|
20
|
+
if options[:template].nil? || options[:template] == action_name
|
|
21
|
+
options[:template] = filename.gsub(%r{^.*/}, '')
|
|
22
|
+
options[:prefixes] ||= [controller_path]
|
|
20
23
|
end
|
|
21
24
|
|
|
22
25
|
# disposition / filename
|
|
@@ -24,7 +27,7 @@ WorkbookRails::FORMATS.each do |format|
|
|
|
24
27
|
if (file_name = options.delete(:filename))
|
|
25
28
|
file_name += ".#{format}" unless file_name =~ /\.#{format}$/
|
|
26
29
|
else
|
|
27
|
-
file_name = "#{filename.gsub(
|
|
30
|
+
file_name = "#{filename.gsub(%r{^.*/}, '')}.#{format}"
|
|
28
31
|
end
|
|
29
32
|
|
|
30
33
|
options = options.merge(layout: false)
|
|
@@ -34,13 +37,15 @@ end
|
|
|
34
37
|
|
|
35
38
|
# For respond_to default
|
|
36
39
|
if ActionController.const_defined? 'Responder'
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
@default_response
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
module ActionController
|
|
41
|
+
class Responder
|
|
42
|
+
WorkbookRails::FORMATS.each do |format|
|
|
43
|
+
define_method "to_#{format}" do
|
|
44
|
+
if @default_response
|
|
45
|
+
@default_response.call(options)
|
|
46
|
+
else
|
|
47
|
+
controller.render options.reverse_merge(format => controller.action_name)
|
|
48
|
+
end
|
|
44
49
|
end
|
|
45
50
|
end
|
|
46
51
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'workbook'
|
|
2
4
|
require 'workbook_rails/template_handler'
|
|
3
5
|
|
|
@@ -14,11 +16,9 @@ module WorkbookRails
|
|
|
14
16
|
require 'workbook_rails/action_controller'
|
|
15
17
|
|
|
16
18
|
unless Mime[:xlsx]
|
|
17
|
-
Mime::Type.register
|
|
18
|
-
end
|
|
19
|
-
unless Mime[:xls]
|
|
20
|
-
Mime::Type.register "application/vnd.ms-excel", :xls
|
|
19
|
+
Mime::Type.register 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', :xlsx
|
|
21
20
|
end
|
|
21
|
+
Mime::Type.register 'application/vnd.ms-excel', :xls unless Mime[:xls]
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module WorkbookRails
|
|
2
4
|
class TemplateHandler
|
|
3
5
|
class_attribute :default_format
|
|
@@ -7,7 +9,7 @@ module WorkbookRails
|
|
|
7
9
|
case format
|
|
8
10
|
when :csv then workbook.sheet.table.to_csv
|
|
9
11
|
when :xlsx then workbook.stream_xlsx
|
|
10
|
-
when :xls
|
|
12
|
+
when :xls
|
|
11
13
|
io = StringIO.new
|
|
12
14
|
xls = workbook.is_a?(Spreadsheet::Workbook) ? workbook : workbook.to_xls
|
|
13
15
|
xls.write(io)
|
|
@@ -16,10 +18,9 @@ module WorkbookRails
|
|
|
16
18
|
end
|
|
17
19
|
|
|
18
20
|
def self.call(template, source = nil)
|
|
19
|
-
"workbook = Workbook::Book.new;\n"
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
"workbook = Workbook::Book.new;\n" \
|
|
22
|
+
"#{source || template.source};\n" \
|
|
23
|
+
'WorkbookRails::TemplateHandler.workbook_to_string(workbook, lookup_context.formats.last);'
|
|
22
24
|
end
|
|
23
|
-
|
|
24
25
|
end
|
|
25
26
|
end
|