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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +8 -7
  3. data/Gemfile.lock +206 -172
  4. data/README.md +3 -3
  5. data/Rakefile +7 -19
  6. data/lib/tasks/workbook_rails_tasks.rake +2 -0
  7. data/lib/workbook_rails/action_controller.rb +15 -10
  8. data/lib/workbook_rails/engine.rb +4 -4
  9. data/lib/workbook_rails/template_handler.rb +6 -5
  10. data/lib/workbook_rails/version.rb +3 -1
  11. data/lib/workbook_rails.rb +3 -2
  12. data/spec/ci.rb +5 -1
  13. data/spec/dummy/Rakefile +3 -1
  14. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  15. data/spec/dummy/app/controllers/home_controller.rb +14 -16
  16. data/spec/dummy/app/controllers/likes_controller.rb +3 -1
  17. data/spec/dummy/app/controllers/users_controller.rb +4 -2
  18. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  19. data/spec/dummy/app/mailers/notifier.rb +5 -4
  20. data/spec/dummy/app/models/like.rb +2 -0
  21. data/spec/dummy/app/models/user.rb +2 -0
  22. data/spec/dummy/bin/bundle +3 -1
  23. data/spec/dummy/bin/rails +3 -1
  24. data/spec/dummy/bin/rake +2 -0
  25. data/spec/dummy/config/application.rb +9 -8
  26. data/spec/dummy/config/boot.rb +4 -2
  27. data/spec/dummy/config/environment.rb +3 -1
  28. data/spec/dummy/config/environments/development.rb +2 -0
  29. data/spec/dummy/config/environments/production.rb +2 -0
  30. data/spec/dummy/config/environments/test.rb +6 -4
  31. data/spec/dummy/config/initializers/backtrace_silencers.rb +2 -0
  32. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -1
  33. data/spec/dummy/config/initializers/filter_parameter_logging.rb +2 -0
  34. data/spec/dummy/config/initializers/inflections.rb +2 -0
  35. data/spec/dummy/config/initializers/mime_types.rb +2 -0
  36. data/spec/dummy/config/initializers/secret_token.rb +3 -1
  37. data/spec/dummy/config/initializers/session_store.rb +2 -0
  38. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -0
  39. data/spec/dummy/config/routes.rb +13 -11
  40. data/spec/dummy/config.ru +3 -1
  41. data/spec/dummy/db/migrate/20120717192452_create_users.rb +2 -0
  42. data/spec/dummy/db/migrate/20121206210955_create_likes.rb +2 -0
  43. data/spec/dummy/db/schema.rb +1 -2
  44. data/spec/dummy/db/test.sqlite3 +0 -0
  45. data/spec/dummy/log/test.log +6916 -16248
  46. data/spec/spec_helper.rb +14 -14
  47. data/spec/template_handler_spec.rb +12 -15
  48. data/spec/test_7.2.sh +6 -0
  49. data/spec/test_8.0.sh +6 -0
  50. data/spec/test_8.1.sh +6 -0
  51. data/spec/test_all_rails.sh +10 -4
  52. data/spec/workbook_mailer_spec.rb +9 -4
  53. data/spec/workbook_renderer_spec.rb +10 -10
  54. data/spec/workbook_request_spec.rb +60 -49
  55. metadata +13 -20
  56. data/spec/dummy/log/development.log +0 -24
  57. data/spec/test_6.0.sh +0 -4
  58. data/spec/test_6.1.sh +0 -4
  59. data/spec/test_7.0.sh +0 -4
  60. data/spec/test_7.1.sh +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2ed8560abd5c51b7febd1b20a2caf617154baab4c6762cd7ad8c82b5a8829ff
4
- data.tar.gz: 142494faaba8f5d90f5dabfe29979886b8f3895c369ce64665d826136208dd37
3
+ metadata.gz: 59888c905d996c59225f4f4f6b20ec16f0eb849cd30326f8f8c5f217eb0a766c
4
+ data.tar.gz: a94ef7862f9e37d3967c3312672d740e9b819673d2f9cd56b256457b353f4b61
5
5
  SHA512:
6
- metadata.gz: 312c0a2649e8ae267befd09115049fafe9cbc7a814e6ded8d0c714330181d8f58750347cf7b28ec2a67eaf9c3cd1d02a179a9aad288192e332594b9376d0b7f6
7
- data.tar.gz: 754201337d2ac1bdf444b650f4db6910043ff011e47cee89cb0e1047812ebc44a06f7bab9b969eb63f2d7ac31ba2ad2c1138c7c52a250e0ed0489a40bd82f8d2
6
+ metadata.gz: 2918be57d144c3d6c219f2132768f5abe7eb932c2d6fcc260b13a1df71ccae024cff238911cd184cbe3318a581205cb9dad6f92f8dc6dc5d0d2092d2f0842d24
7
+ data.tar.gz: b5ed51f1aeb8922eeeeb76be199a31fed68b6b1eb4de3dd2921aeb69fc32d964952a395d5ddf92d14acd3e58308b7903f0e3320ce5af3b452499d1dbd2a46622
data/Gemfile CHANGED
@@ -1,11 +1,13 @@
1
- source "https://rubygems.org"
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', "~> 6.1.0"
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 'simplecov', require: false
21
- gem 'codeclimate-test-reporter', require: false
22
- gem "rspec-rails"
23
- gem "sqlite3"
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.0)
5
- actionpack (>= 3.2)
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
- actioncable (6.1.7.7)
12
- actionpack (= 6.1.7.7)
13
- activesupport (= 6.1.7.7)
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
- actionmailbox (6.1.7.7)
17
- actionpack (= 6.1.7.7)
18
- activejob (= 6.1.7.7)
19
- activerecord (= 6.1.7.7)
20
- activestorage (= 6.1.7.7)
21
- activesupport (= 6.1.7.7)
22
- mail (>= 2.7.1)
23
- actionmailer (6.1.7.7)
24
- actionpack (= 6.1.7.7)
25
- actionview (= 6.1.7.7)
26
- activejob (= 6.1.7.7)
27
- activesupport (= 6.1.7.7)
28
- mail (~> 2.5, >= 2.5.4)
29
- rails-dom-testing (~> 2.0)
30
- actionpack (6.1.7.7)
31
- actionview (= 6.1.7.7)
32
- activesupport (= 6.1.7.7)
33
- rack (~> 2.0, >= 2.0.9)
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.0)
36
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
37
- actiontext (6.1.7.7)
38
- actionpack (= 6.1.7.7)
39
- activerecord (= 6.1.7.7)
40
- activestorage (= 6.1.7.7)
41
- activesupport (= 6.1.7.7)
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 (6.1.7.7)
44
- activesupport (= 6.1.7.7)
51
+ actionview (8.1.4.1)
52
+ activesupport (= 8.1.4.1)
45
53
  builder (~> 3.1)
46
- erubi (~> 1.4)
47
- rails-dom-testing (~> 2.0)
48
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
- activejob (6.1.7.7)
50
- activesupport (= 6.1.7.7)
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 (6.1.7.7)
53
- activesupport (= 6.1.7.7)
54
- activerecord (6.1.7.7)
55
- activemodel (= 6.1.7.7)
56
- activesupport (= 6.1.7.7)
57
- activestorage (6.1.7.7)
58
- actionpack (= 6.1.7.7)
59
- activejob (= 6.1.7.7)
60
- activerecord (= 6.1.7.7)
61
- activesupport (= 6.1.7.7)
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
- mini_mime (>= 1.1.0)
64
- activesupport (6.1.7.7)
65
- concurrent-ruby (~> 1.0, >= 1.0.2)
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
- tzinfo (~> 2.0)
69
- zeitwerk (~> 2.3)
70
- addressable (2.8.6)
71
- public_suffix (>= 2.0.2, < 6.0)
72
- axlsx (3.0.0.pre)
73
- htmlentities (~> 4.3, >= 4.3.4)
74
- mimemagic (~> 0.3)
75
- nokogiri (~> 1.8, >= 1.8.2)
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
- codeclimate-test-reporter (1.0.7)
87
- simplecov
88
- concurrent-ruby (1.2.3)
89
- coveralls (0.8.23)
90
- json (>= 1.8, < 3)
91
- simplecov (~> 0.16.1)
92
- term-ansicolor (~> 1.3)
93
- thor (>= 0.19.4, < 2.0)
94
- tins (~> 1.6)
95
- crass (1.0.6)
96
- date (3.3.4)
97
- diff-lcs (1.5.1)
98
- docile (1.1.5)
99
- erubi (1.12.0)
100
- globalid (1.2.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.3.4)
103
- i18n (1.14.5)
113
+ htmlentities (4.4.2)
114
+ i18n (1.15.2)
104
115
  concurrent-ruby (~> 1.0)
105
- json (2.7.2)
106
- loofah (2.22.0)
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.12.0)
109
- mail (2.8.1)
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.0.4)
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.6)
121
- minitest (5.23.1)
122
- net-imap (0.3.7)
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.2.2)
144
+ net-protocol (0.4.0)
128
145
  timeout
129
- net-smtp (0.5.0)
146
+ net-smtp (0.5.2)
130
147
  net-protocol
131
- nio4r (2.7.3)
132
- nokogiri (1.16.5)
148
+ nio4r (2.7.5)
149
+ nokogiri (1.19.7)
133
150
  mini_portile2 (~> 2.8.2)
134
151
  racc (~> 1.4)
135
- public_suffix (5.0.5)
136
- racc (1.8.0)
137
- rack (2.2.9)
138
- rack-test (2.1.0)
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
- rails (6.1.7.7)
141
- actioncable (= 6.1.7.7)
142
- actionmailbox (= 6.1.7.7)
143
- actionmailer (= 6.1.7.7)
144
- actionpack (= 6.1.7.7)
145
- actiontext (= 6.1.7.7)
146
- actionview (= 6.1.7.7)
147
- activejob (= 6.1.7.7)
148
- activemodel (= 6.1.7.7)
149
- activerecord (= 6.1.7.7)
150
- activestorage (= 6.1.7.7)
151
- activesupport (= 6.1.7.7)
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 (= 6.1.7.7)
154
- sprockets-rails (>= 2.0.0)
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.5.0)
160
- loofah (~> 2.19, >= 2.19.1)
161
- railties (6.1.7.7)
162
- actionpack (= 6.1.7.7)
163
- activesupport (= 6.1.7.7)
164
- method_source
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
- rake (13.2.1)
168
- rchardet (1.8.0)
169
- responders (3.1.1)
170
- actionpack (>= 5.2)
171
- railties (>= 5.2)
172
- rspec-core (3.13.0)
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.0)
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.1)
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 (6.1.2)
181
- actionpack (>= 6.1)
182
- activesupport (>= 6.1)
183
- railties (>= 6.1)
184
- rspec-core (~> 3.13)
185
- rspec-expectations (~> 3.13)
186
- rspec-mocks (~> 3.13)
187
- rspec-support (~> 3.13)
188
- rspec-support (3.13.1)
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 (1.3.0)
191
- simplecov (0.16.1)
192
- docile (~> 1.1)
193
- json (>= 1.8, < 3)
194
- simplecov-html (~> 0.10.0)
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
- sprockets (4.2.1)
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
- term-ansicolor (1.6.0)
209
- tins (~> 1.0)
210
- thor (1.3.1)
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
- websocket-driver (0.7.6)
216
- websocket-extensions (>= 0.1.0)
217
- websocket-extensions (0.1.5)
218
- workbook (0.8.1)
219
- axlsx (~> 3.0.0.pre)
220
- json (~> 2.1)
221
- nokogiri (~> 1.8)
222
- rchardet (~> 1.3)
223
- spreadsheet (~> 1.1)
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.6.14)
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
- codeclimate-test-reporter
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
- 2.4.22
279
+ 4.1.0
data/README.md CHANGED
@@ -4,8 +4,7 @@ Workbook-Rails &mdash; Workbook templates for Rails views
4
4
  [![Gem
5
5
  Version](https://badge.fury.io/rb/workbook_rails.svg)](http://badge.fury.io/rb/workbook_rails)
6
6
  [![Build Status](https://github.com/scambra/workbook_rails/actions/workflows/ruby.yml/badge.svg)](https://github.com/scambra/workbook_rails/actions/workflows/ruby.yml)
7
- [![Maintainability](https://api.codeclimate.com/v1/badges/99cc4757969d308f258c/maintainability)](https://codeclimate.com/github/scambra/workbook_rails/maintainability)
8
- [![Coverage Status](https://coveralls.io/repos/github/scambra/workbook_rails/badge.svg?branch=master)](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
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
10
9
 
11
10
 
@@ -19,7 +18,8 @@ gem 'workbook_rails'
19
18
 
20
19
  ## Requirements
21
20
 
22
- * Rails 6.0 to 7.1 (tested)
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
- begin
3
- require 'bundler/setup'
4
- rescue LoadError
5
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
- end
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
- begin
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 :default => :spec
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
  # desc "Explaining what the task does"
2
4
  # task :workbook_rails do
3
5
  # # Task goes here
@@ -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(/^.*\//,'')}.#{format}"
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
- class ActionController::Responder
38
- WorkbookRails::FORMATS.each do |format|
39
- define_method "to_#{format}" do
40
- if @default_response
41
- @default_response.call(options)
42
- else
43
- controller.render options.reverse_merge(format => controller.action_name)
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 "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", :xlsx
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 then
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
- (source || template.source) +
21
- ";\nWorkbookRails::TemplateHandler.workbook_to_string(workbook, lookup_context.formats.last);"
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