comma 4.7.0 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +2 -23
  3. data/.rubocop.yml +1 -1
  4. data/.rubocop_todo.yml +96 -49
  5. data/Appraisals +25 -34
  6. data/Gemfile +1 -1
  7. data/Gemfile.lock +63 -58
  8. data/README.md +2 -2
  9. data/gemfiles/{active5.2.5.gemfile → active6.0.6.gemfile} +3 -3
  10. data/gemfiles/{active6.0.3.6.gemfile.lock → active6.0.6.gemfile.lock} +41 -37
  11. data/gemfiles/{active6.1.3.1.gemfile → active6.1.7.6.gemfile} +3 -3
  12. data/gemfiles/{active7.0.0.gemfile.lock → active6.1.7.6.gemfile.lock} +42 -36
  13. data/gemfiles/active7.0.8.gemfile +12 -0
  14. data/gemfiles/{active6.1.3.1.gemfile.lock → active7.0.8.gemfile.lock} +40 -38
  15. data/gemfiles/active7.1.3.gemfile +12 -0
  16. data/gemfiles/{active5.2.5.gemfile.lock → active7.1.3.gemfile.lock} +58 -43
  17. data/gemfiles/{rails6.1.3.1.gemfile → rails6.0.6.gemfile} +2 -2
  18. data/gemfiles/rails6.0.6.gemfile.lock +270 -0
  19. data/gemfiles/{rails6.0.3.6.gemfile → rails6.1.7.6.gemfile} +2 -2
  20. data/gemfiles/rails6.1.7.6.gemfile.lock +273 -0
  21. data/gemfiles/{rails7.0.0.gemfile → rails7.0.8.gemfile} +2 -2
  22. data/gemfiles/rails7.0.8.gemfile.lock +248 -0
  23. data/gemfiles/{active7.0.0.gemfile → rails7.1.3.gemfile} +3 -3
  24. data/gemfiles/rails7.1.3.gemfile.lock +281 -0
  25. data/lib/comma/header_extractor.rb +1 -0
  26. data/lib/comma/version.rb +1 -1
  27. data/lib/comma.rb +1 -0
  28. data/spec/comma/comma_spec.rb +18 -18
  29. data/spec/comma/rails/active_record_spec.rb +1 -1
  30. data/spec/comma/rails/mongoid_spec.rb +1 -1
  31. metadata +38 -23
  32. data/gemfiles/active6.0.3.6.gemfile +0 -12
  33. data/gemfiles/rails5.2.5.gemfile +0 -14
  34. data/gemfiles/rails5.2.5.gemfile.lock +0 -217
  35. data/gemfiles/rails6.0.3.6.gemfile.lock +0 -232
  36. data/gemfiles/rails6.1.3.1.gemfile.lock +0 -235
  37. data/gemfiles/rails7.0.0.gemfile.lock +0 -224
@@ -0,0 +1,248 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ comma (4.8.0)
5
+ activesupport (>= 4.2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (7.0.8)
11
+ actionpack (= 7.0.8)
12
+ activesupport (= 7.0.8)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailbox (7.0.8)
16
+ actionpack (= 7.0.8)
17
+ activejob (= 7.0.8)
18
+ activerecord (= 7.0.8)
19
+ activestorage (= 7.0.8)
20
+ activesupport (= 7.0.8)
21
+ mail (>= 2.7.1)
22
+ net-imap
23
+ net-pop
24
+ net-smtp
25
+ actionmailer (7.0.8)
26
+ actionpack (= 7.0.8)
27
+ actionview (= 7.0.8)
28
+ activejob (= 7.0.8)
29
+ activesupport (= 7.0.8)
30
+ mail (~> 2.5, >= 2.5.4)
31
+ net-imap
32
+ net-pop
33
+ net-smtp
34
+ rails-dom-testing (~> 2.0)
35
+ actionpack (7.0.8)
36
+ actionview (= 7.0.8)
37
+ activesupport (= 7.0.8)
38
+ rack (~> 2.0, >= 2.2.4)
39
+ rack-test (>= 0.6.3)
40
+ rails-dom-testing (~> 2.0)
41
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
42
+ actiontext (7.0.8)
43
+ actionpack (= 7.0.8)
44
+ activerecord (= 7.0.8)
45
+ activestorage (= 7.0.8)
46
+ activesupport (= 7.0.8)
47
+ globalid (>= 0.6.0)
48
+ nokogiri (>= 1.8.5)
49
+ actionview (7.0.8)
50
+ activesupport (= 7.0.8)
51
+ builder (~> 3.1)
52
+ erubi (~> 1.4)
53
+ rails-dom-testing (~> 2.0)
54
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
55
+ activejob (7.0.8)
56
+ activesupport (= 7.0.8)
57
+ globalid (>= 0.3.6)
58
+ activemodel (7.0.8)
59
+ activesupport (= 7.0.8)
60
+ activerecord (7.0.8)
61
+ activemodel (= 7.0.8)
62
+ activesupport (= 7.0.8)
63
+ activestorage (7.0.8)
64
+ actionpack (= 7.0.8)
65
+ activejob (= 7.0.8)
66
+ activerecord (= 7.0.8)
67
+ activesupport (= 7.0.8)
68
+ marcel (~> 1.0)
69
+ mini_mime (>= 1.1.0)
70
+ activesupport (7.0.8)
71
+ concurrent-ruby (~> 1.0, >= 1.0.2)
72
+ i18n (>= 1.6, < 2)
73
+ minitest (>= 5.1)
74
+ tzinfo (~> 2.0)
75
+ appraisal (1.0.3)
76
+ bundler
77
+ rake
78
+ thor (>= 0.14.0)
79
+ ast (2.4.2)
80
+ builder (3.2.4)
81
+ concurrent-ruby (1.2.3)
82
+ coveralls (0.8.23)
83
+ json (>= 1.8, < 3)
84
+ simplecov (~> 0.16.1)
85
+ term-ansicolor (~> 1.3)
86
+ thor (>= 0.19.4, < 2.0)
87
+ tins (~> 1.6)
88
+ crass (1.0.6)
89
+ date (3.3.4)
90
+ diff-lcs (1.5.0)
91
+ docile (1.4.0)
92
+ erubi (1.12.0)
93
+ globalid (1.2.1)
94
+ activesupport (>= 6.1)
95
+ i18n (1.14.1)
96
+ concurrent-ruby (~> 1.0)
97
+ json (2.7.1)
98
+ loofah (2.22.0)
99
+ crass (~> 1.0.2)
100
+ nokogiri (>= 1.12.0)
101
+ mail (2.8.1)
102
+ mini_mime (>= 0.1.1)
103
+ net-imap
104
+ net-pop
105
+ net-smtp
106
+ marcel (1.0.2)
107
+ method_source (1.0.0)
108
+ mini_mime (1.1.5)
109
+ mini_portile2 (2.8.5)
110
+ minitest (5.14.4)
111
+ net-imap (0.4.9.1)
112
+ date
113
+ net-protocol
114
+ net-pop (0.1.2)
115
+ net-protocol
116
+ net-protocol (0.2.2)
117
+ timeout
118
+ net-smtp (0.4.0.1)
119
+ net-protocol
120
+ nio4r (2.7.0)
121
+ nokogiri (1.16.0)
122
+ mini_portile2 (~> 2.8.2)
123
+ racc (~> 1.4)
124
+ parallel (1.24.0)
125
+ parser (3.3.0.4)
126
+ ast (~> 2.4.1)
127
+ racc
128
+ racc (1.7.3)
129
+ rack (2.2.8)
130
+ rack-test (2.1.0)
131
+ rack (>= 1.3)
132
+ rails (7.0.8)
133
+ actioncable (= 7.0.8)
134
+ actionmailbox (= 7.0.8)
135
+ actionmailer (= 7.0.8)
136
+ actionpack (= 7.0.8)
137
+ actiontext (= 7.0.8)
138
+ actionview (= 7.0.8)
139
+ activejob (= 7.0.8)
140
+ activemodel (= 7.0.8)
141
+ activerecord (= 7.0.8)
142
+ activestorage (= 7.0.8)
143
+ activesupport (= 7.0.8)
144
+ bundler (>= 1.15.0)
145
+ railties (= 7.0.8)
146
+ rails-dom-testing (2.2.0)
147
+ activesupport (>= 5.0.0)
148
+ minitest
149
+ nokogiri (>= 1.6)
150
+ rails-html-sanitizer (1.6.0)
151
+ loofah (~> 2.21)
152
+ nokogiri (~> 1.14)
153
+ railties (7.0.8)
154
+ actionpack (= 7.0.8)
155
+ activesupport (= 7.0.8)
156
+ method_source
157
+ rake (>= 12.2)
158
+ thor (~> 1.0)
159
+ zeitwerk (~> 2.5)
160
+ rainbow (3.1.1)
161
+ rake (13.0.6)
162
+ regexp_parser (2.9.0)
163
+ rexml (3.2.6)
164
+ rspec (3.5.0)
165
+ rspec-core (~> 3.5.0)
166
+ rspec-expectations (~> 3.5.0)
167
+ rspec-mocks (~> 3.5.0)
168
+ rspec-activemodel-mocks (1.2.0)
169
+ activemodel (>= 3.0)
170
+ activesupport (>= 3.0)
171
+ rspec-mocks (>= 2.99, < 4.0)
172
+ rspec-core (3.5.4)
173
+ rspec-support (~> 3.5.0)
174
+ rspec-expectations (3.5.0)
175
+ diff-lcs (>= 1.2.0, < 2.0)
176
+ rspec-support (~> 3.5.0)
177
+ rspec-its (1.3.0)
178
+ rspec-core (>= 3.0.0)
179
+ rspec-expectations (>= 3.0.0)
180
+ rspec-mocks (3.5.0)
181
+ diff-lcs (>= 1.2.0, < 2.0)
182
+ rspec-support (~> 3.5.0)
183
+ rspec-rails (3.5.2)
184
+ actionpack (>= 3.0)
185
+ activesupport (>= 3.0)
186
+ railties (>= 3.0)
187
+ rspec-core (~> 3.5.0)
188
+ rspec-expectations (~> 3.5.0)
189
+ rspec-mocks (~> 3.5.0)
190
+ rspec-support (~> 3.5.0)
191
+ rspec-support (3.5.0)
192
+ rubocop (1.30.1)
193
+ parallel (~> 1.10)
194
+ parser (>= 3.1.0.0)
195
+ rainbow (>= 2.2.2, < 4.0)
196
+ regexp_parser (>= 1.8, < 3.0)
197
+ rexml (>= 3.2.5, < 4.0)
198
+ rubocop-ast (>= 1.18.0, < 2.0)
199
+ ruby-progressbar (~> 1.7)
200
+ unicode-display_width (>= 1.4.0, < 3.0)
201
+ rubocop-ast (1.30.0)
202
+ parser (>= 3.2.1.0)
203
+ rubocop-performance (1.19.1)
204
+ rubocop (>= 1.7.0, < 2.0)
205
+ rubocop-ast (>= 0.4.0)
206
+ ruby-progressbar (1.13.0)
207
+ simplecov (0.16.1)
208
+ docile (~> 1.1)
209
+ json (>= 1.8, < 3)
210
+ simplecov-html (~> 0.10.0)
211
+ simplecov-html (0.10.2)
212
+ sqlite3 (1.7.0)
213
+ mini_portile2 (~> 2.8.0)
214
+ sync (0.5.0)
215
+ term-ansicolor (1.7.1)
216
+ tins (~> 1.0)
217
+ thor (1.3.0)
218
+ timeout (0.4.1)
219
+ tins (1.32.1)
220
+ sync
221
+ tzinfo (2.0.6)
222
+ concurrent-ruby (~> 1.0)
223
+ unicode-display_width (2.5.0)
224
+ websocket-driver (0.7.6)
225
+ websocket-extensions (>= 0.1.0)
226
+ websocket-extensions (0.1.5)
227
+ zeitwerk (2.6.12)
228
+
229
+ PLATFORMS
230
+ ruby
231
+
232
+ DEPENDENCIES
233
+ appraisal (~> 1.0.0)
234
+ comma!
235
+ coveralls
236
+ minitest (= 5.14.4)
237
+ rails (= 7.0.8)
238
+ rake (~> 13.0.1)
239
+ rspec (~> 3.5.0)
240
+ rspec-activemodel-mocks
241
+ rspec-its
242
+ rspec-rails
243
+ rubocop (~> 1.30.0)
244
+ rubocop-performance
245
+ sqlite3
246
+
247
+ BUNDLED WITH
248
+ 2.5.5
@@ -3,10 +3,10 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "coveralls", :require => false
6
- gem "rubocop", "~> 1.0.0", :require => false
6
+ gem "rubocop", "~> 1.30.0", :require => false
7
7
  gem "rubocop-performance", :require => false
8
8
  gem "sqlite3"
9
- gem "activesupport", "7.0.0"
10
- gem "activerecord", "7.0.0"
9
+ gem "rails", "7.1.3"
10
+ gem "rspec-rails"
11
11
 
12
12
  gemspec :path => "../"
@@ -0,0 +1,281 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ comma (4.8.0)
5
+ activesupport (>= 4.2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (7.1.3)
11
+ actionpack (= 7.1.3)
12
+ activesupport (= 7.1.3)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ zeitwerk (~> 2.6)
16
+ actionmailbox (7.1.3)
17
+ actionpack (= 7.1.3)
18
+ activejob (= 7.1.3)
19
+ activerecord (= 7.1.3)
20
+ activestorage (= 7.1.3)
21
+ activesupport (= 7.1.3)
22
+ mail (>= 2.7.1)
23
+ net-imap
24
+ net-pop
25
+ net-smtp
26
+ actionmailer (7.1.3)
27
+ actionpack (= 7.1.3)
28
+ actionview (= 7.1.3)
29
+ activejob (= 7.1.3)
30
+ activesupport (= 7.1.3)
31
+ mail (~> 2.5, >= 2.5.4)
32
+ net-imap
33
+ net-pop
34
+ net-smtp
35
+ rails-dom-testing (~> 2.2)
36
+ actionpack (7.1.3)
37
+ actionview (= 7.1.3)
38
+ activesupport (= 7.1.3)
39
+ nokogiri (>= 1.8.5)
40
+ racc
41
+ rack (>= 2.2.4)
42
+ rack-session (>= 1.0.1)
43
+ rack-test (>= 0.6.3)
44
+ rails-dom-testing (~> 2.2)
45
+ rails-html-sanitizer (~> 1.6)
46
+ actiontext (7.1.3)
47
+ actionpack (= 7.1.3)
48
+ activerecord (= 7.1.3)
49
+ activestorage (= 7.1.3)
50
+ activesupport (= 7.1.3)
51
+ globalid (>= 0.6.0)
52
+ nokogiri (>= 1.8.5)
53
+ actionview (7.1.3)
54
+ activesupport (= 7.1.3)
55
+ builder (~> 3.1)
56
+ erubi (~> 1.11)
57
+ rails-dom-testing (~> 2.2)
58
+ rails-html-sanitizer (~> 1.6)
59
+ activejob (7.1.3)
60
+ activesupport (= 7.1.3)
61
+ globalid (>= 0.3.6)
62
+ activemodel (7.1.3)
63
+ activesupport (= 7.1.3)
64
+ activerecord (7.1.3)
65
+ activemodel (= 7.1.3)
66
+ activesupport (= 7.1.3)
67
+ timeout (>= 0.4.0)
68
+ activestorage (7.1.3)
69
+ actionpack (= 7.1.3)
70
+ activejob (= 7.1.3)
71
+ activerecord (= 7.1.3)
72
+ activesupport (= 7.1.3)
73
+ marcel (~> 1.0)
74
+ activesupport (7.1.3)
75
+ base64
76
+ bigdecimal
77
+ concurrent-ruby (~> 1.0, >= 1.0.2)
78
+ connection_pool (>= 2.2.5)
79
+ drb
80
+ i18n (>= 1.6, < 2)
81
+ minitest (>= 5.1)
82
+ mutex_m
83
+ tzinfo (~> 2.0)
84
+ appraisal (1.0.3)
85
+ bundler
86
+ rake
87
+ thor (>= 0.14.0)
88
+ ast (2.4.2)
89
+ base64 (0.2.0)
90
+ bigdecimal (3.1.6)
91
+ builder (3.2.4)
92
+ concurrent-ruby (1.2.3)
93
+ connection_pool (2.4.1)
94
+ coveralls (0.8.23)
95
+ json (>= 1.8, < 3)
96
+ simplecov (~> 0.16.1)
97
+ term-ansicolor (~> 1.3)
98
+ thor (>= 0.19.4, < 2.0)
99
+ tins (~> 1.6)
100
+ crass (1.0.6)
101
+ date (3.3.4)
102
+ diff-lcs (1.5.0)
103
+ docile (1.4.0)
104
+ drb (2.2.0)
105
+ ruby2_keywords
106
+ erubi (1.12.0)
107
+ globalid (1.2.1)
108
+ activesupport (>= 6.1)
109
+ i18n (1.14.1)
110
+ concurrent-ruby (~> 1.0)
111
+ io-console (0.7.2)
112
+ irb (1.11.1)
113
+ rdoc
114
+ reline (>= 0.4.2)
115
+ json (2.7.1)
116
+ loofah (2.22.0)
117
+ crass (~> 1.0.2)
118
+ nokogiri (>= 1.12.0)
119
+ mail (2.8.1)
120
+ mini_mime (>= 0.1.1)
121
+ net-imap
122
+ net-pop
123
+ net-smtp
124
+ marcel (1.0.2)
125
+ mini_mime (1.1.5)
126
+ mini_portile2 (2.8.5)
127
+ minitest (5.14.4)
128
+ mutex_m (0.2.0)
129
+ net-imap (0.4.9.1)
130
+ date
131
+ net-protocol
132
+ net-pop (0.1.2)
133
+ net-protocol
134
+ net-protocol (0.2.2)
135
+ timeout
136
+ net-smtp (0.4.0.1)
137
+ net-protocol
138
+ nio4r (2.7.0)
139
+ nokogiri (1.16.0)
140
+ mini_portile2 (~> 2.8.2)
141
+ racc (~> 1.4)
142
+ parallel (1.24.0)
143
+ parser (3.3.0.4)
144
+ ast (~> 2.4.1)
145
+ racc
146
+ psych (5.1.2)
147
+ stringio
148
+ racc (1.7.3)
149
+ rack (3.0.8)
150
+ rack-session (2.0.0)
151
+ rack (>= 3.0.0)
152
+ rack-test (2.1.0)
153
+ rack (>= 1.3)
154
+ rackup (2.1.0)
155
+ rack (>= 3)
156
+ webrick (~> 1.8)
157
+ rails (7.1.3)
158
+ actioncable (= 7.1.3)
159
+ actionmailbox (= 7.1.3)
160
+ actionmailer (= 7.1.3)
161
+ actionpack (= 7.1.3)
162
+ actiontext (= 7.1.3)
163
+ actionview (= 7.1.3)
164
+ activejob (= 7.1.3)
165
+ activemodel (= 7.1.3)
166
+ activerecord (= 7.1.3)
167
+ activestorage (= 7.1.3)
168
+ activesupport (= 7.1.3)
169
+ bundler (>= 1.15.0)
170
+ railties (= 7.1.3)
171
+ rails-dom-testing (2.2.0)
172
+ activesupport (>= 5.0.0)
173
+ minitest
174
+ nokogiri (>= 1.6)
175
+ rails-html-sanitizer (1.6.0)
176
+ loofah (~> 2.21)
177
+ nokogiri (~> 1.14)
178
+ railties (7.1.3)
179
+ actionpack (= 7.1.3)
180
+ activesupport (= 7.1.3)
181
+ irb
182
+ rackup (>= 1.0.0)
183
+ rake (>= 12.2)
184
+ thor (~> 1.0, >= 1.2.2)
185
+ zeitwerk (~> 2.6)
186
+ rainbow (3.1.1)
187
+ rake (13.0.6)
188
+ rdoc (6.6.2)
189
+ psych (>= 4.0.0)
190
+ regexp_parser (2.9.0)
191
+ reline (0.4.2)
192
+ io-console (~> 0.5)
193
+ rexml (3.2.6)
194
+ rspec (3.5.0)
195
+ rspec-core (~> 3.5.0)
196
+ rspec-expectations (~> 3.5.0)
197
+ rspec-mocks (~> 3.5.0)
198
+ rspec-activemodel-mocks (1.2.0)
199
+ activemodel (>= 3.0)
200
+ activesupport (>= 3.0)
201
+ rspec-mocks (>= 2.99, < 4.0)
202
+ rspec-core (3.5.4)
203
+ rspec-support (~> 3.5.0)
204
+ rspec-expectations (3.5.0)
205
+ diff-lcs (>= 1.2.0, < 2.0)
206
+ rspec-support (~> 3.5.0)
207
+ rspec-its (1.3.0)
208
+ rspec-core (>= 3.0.0)
209
+ rspec-expectations (>= 3.0.0)
210
+ rspec-mocks (3.5.0)
211
+ diff-lcs (>= 1.2.0, < 2.0)
212
+ rspec-support (~> 3.5.0)
213
+ rspec-rails (3.5.2)
214
+ actionpack (>= 3.0)
215
+ activesupport (>= 3.0)
216
+ railties (>= 3.0)
217
+ rspec-core (~> 3.5.0)
218
+ rspec-expectations (~> 3.5.0)
219
+ rspec-mocks (~> 3.5.0)
220
+ rspec-support (~> 3.5.0)
221
+ rspec-support (3.5.0)
222
+ rubocop (1.30.1)
223
+ parallel (~> 1.10)
224
+ parser (>= 3.1.0.0)
225
+ rainbow (>= 2.2.2, < 4.0)
226
+ regexp_parser (>= 1.8, < 3.0)
227
+ rexml (>= 3.2.5, < 4.0)
228
+ rubocop-ast (>= 1.18.0, < 2.0)
229
+ ruby-progressbar (~> 1.7)
230
+ unicode-display_width (>= 1.4.0, < 3.0)
231
+ rubocop-ast (1.30.0)
232
+ parser (>= 3.2.1.0)
233
+ rubocop-performance (1.19.1)
234
+ rubocop (>= 1.7.0, < 2.0)
235
+ rubocop-ast (>= 0.4.0)
236
+ ruby-progressbar (1.13.0)
237
+ ruby2_keywords (0.0.5)
238
+ simplecov (0.16.1)
239
+ docile (~> 1.1)
240
+ json (>= 1.8, < 3)
241
+ simplecov-html (~> 0.10.0)
242
+ simplecov-html (0.10.2)
243
+ sqlite3 (1.7.0)
244
+ mini_portile2 (~> 2.8.0)
245
+ stringio (3.1.0)
246
+ sync (0.5.0)
247
+ term-ansicolor (1.7.1)
248
+ tins (~> 1.0)
249
+ thor (1.3.0)
250
+ timeout (0.4.1)
251
+ tins (1.32.1)
252
+ sync
253
+ tzinfo (2.0.6)
254
+ concurrent-ruby (~> 1.0)
255
+ unicode-display_width (2.5.0)
256
+ webrick (1.8.1)
257
+ websocket-driver (0.7.6)
258
+ websocket-extensions (>= 0.1.0)
259
+ websocket-extensions (0.1.5)
260
+ zeitwerk (2.6.12)
261
+
262
+ PLATFORMS
263
+ ruby
264
+
265
+ DEPENDENCIES
266
+ appraisal (~> 1.0.0)
267
+ comma!
268
+ coveralls
269
+ minitest (= 5.14.4)
270
+ rails (= 7.1.3)
271
+ rake (~> 13.0.1)
272
+ rspec (~> 3.5.0)
273
+ rspec-activemodel-mocks
274
+ rspec-its
275
+ rspec-rails
276
+ rubocop (~> 1.30.0)
277
+ rubocop-performance
278
+ sqlite3
279
+
280
+ BUNDLED WITH
281
+ 2.5.5
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'comma/extractor'
4
+ require 'active_support'
4
5
  require 'active_support/core_ext/class/attribute'
5
6
  require 'active_support/core_ext/date_time/conversions'
6
7
  require 'active_support/core_ext/object/blank'
data/lib/comma/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Comma
4
- VERSION = '4.7.0'
4
+ VERSION = '4.8.0'
5
5
  end
data/lib/comma.rb CHANGED
@@ -10,6 +10,7 @@ module Comma
10
10
  }.freeze
11
11
  end
12
12
 
13
+ require 'active_support'
13
14
  require 'active_support/lazy_load_hooks'
14
15
  ActiveSupport.on_load(:active_record) do
15
16
  require 'comma/relation' if defined?(ActiveRecord::Relation)
@@ -40,7 +40,7 @@ describe Comma, 'generating CSV' do # rubocop:disable Metrics/BlockLength
40
40
  end
41
41
 
42
42
  it 'should extend Array to add a #to_comma method which will return CSV content for objects within the array' do
43
- expected = "Title,Description,Issuer,ISBN-10,ISBN-13\nSmalltalk-80,Language and Implementation,ISBN,123123123,321321321\n" # rubocop:disable Metrics/LineLength
43
+ expected = "Title,Description,Issuer,ISBN-10,ISBN-13\nSmalltalk-80,Language and Implementation,ISBN,123123123,321321321\n" # rubocop:disable Layout/LineLength
44
44
  expect(@books.to_comma).to eq(expected)
45
45
  end
46
46
 
@@ -57,25 +57,25 @@ describe Comma, 'generating CSV' do # rubocop:disable Metrics/BlockLength
57
57
 
58
58
  it 'should write to the file' do
59
59
  @books.to_comma(filename: 'comma.csv')
60
- expected = "Title,Description,Issuer,ISBN-10,ISBN-13\nSmalltalk-80,Language and Implementation,ISBN,123123123,321321321\n" # rubocop:disable Metrics/LineLength
60
+ expected = "Title,Description,Issuer,ISBN-10,ISBN-13\nSmalltalk-80,Language and Implementation,ISBN,123123123,321321321\n" # rubocop:disable Layout/LineLength
61
61
  expect(File.read('comma.csv')).to eq(expected)
62
62
  end
63
63
 
64
64
  it 'should accept FasterCSV options' do
65
65
  @books.to_comma(filename: 'comma.csv', col_sep: ';', force_quotes: true)
66
- expected = "\"Title\";\"Description\";\"Issuer\";\"ISBN-10\";\"ISBN-13\"\n\"Smalltalk-80\";\"Language and Implementation\";\"ISBN\";\"123123123\";\"321321321\"\n" # rubocop:disable Metrics/LineLength
66
+ expected = "\"Title\";\"Description\";\"Issuer\";\"ISBN-10\";\"ISBN-13\"\n\"Smalltalk-80\";\"Language and Implementation\";\"ISBN\";\"123123123\";\"321321321\"\n" # rubocop:disable Layout/LineLength
67
67
  expect(File.read('comma.csv')).to eq(expected)
68
68
  end
69
69
  end
70
70
 
71
71
  describe 'with FasterCSV options' do
72
72
  it 'should not change when options are empty' do
73
- expected = "Title,Description,Issuer,ISBN-10,ISBN-13\nSmalltalk-80,Language and Implementation,ISBN,123123123,321321321\n" # rubocop:disable Metrics/LineLength
73
+ expected = "Title,Description,Issuer,ISBN-10,ISBN-13\nSmalltalk-80,Language and Implementation,ISBN,123123123,321321321\n" # rubocop:disable Layout/LineLength
74
74
  expect(@books.to_comma({})).to eq(expected)
75
75
  end
76
76
 
77
77
  it 'should accept the options in #to_comma and generate the appropriate CSV' do
78
- expected = "\"Title\";\"Description\";\"Issuer\";\"ISBN-10\";\"ISBN-13\"\n\"Smalltalk-80\";\"Language and Implementation\";\"ISBN\";\"123123123\";\"321321321\"\n" # rubocop:disable Metrics/LineLength
78
+ expected = "\"Title\";\"Description\";\"Issuer\";\"ISBN-10\";\"ISBN-13\"\n\"Smalltalk-80\";\"Language and Implementation\";\"ISBN\";\"123123123\";\"321321321\"\n" # rubocop:disable Layout/LineLength
79
79
  expect(@books.to_comma(col_sep: ';', force_quotes: true)).to eq(expected)
80
80
  end
81
81
 
@@ -177,17 +177,17 @@ describe Comma, 'to_comma data/headers object extensions' do # rubocop:disable M
177
177
  end
178
178
  end
179
179
 
180
- describe 'with block' do # rubocop:disable BlockLength
180
+ describe 'with block' do # rubocop:disable Metrics/BlockLength
181
181
  before do
182
182
  class Foo
183
183
  attr_accessor :content, :created_at, :updated_at
184
184
  comma do
185
185
  content
186
186
  content('Truncated Content') { |i| i && i.length > 10 ? i[0..10] : '---' }
187
- created_at { |i| i&.to_s(:db) }
188
- updated_at { |i| i&.to_s(:db) }
189
- created_at 'Created Custom Label' do |i| i&.to_s(:short) end
190
- updated_at 'Updated at Custom Label' do |i| i&.to_s(:short) end
187
+ created_at { |i| i&.to_formatted_s(:db) }
188
+ updated_at { |i| i&.to_formatted_s(:db) }
189
+ created_at 'Created Custom Label' do |i| i&.to_formatted_s(:short) end
190
+ updated_at 'Updated at Custom Label' do |i| i&.to_formatted_s(:short) end
191
191
  end
192
192
 
193
193
  def initialize(content, created_at = Time.now, updated_at = Time.now)
@@ -207,10 +207,10 @@ describe Comma, 'to_comma data/headers object extensions' do # rubocop:disable M
207
207
  expected = [
208
208
  @content,
209
209
  @content[0..10],
210
- @time.to_s(:db),
211
- @time.to_s(:db),
212
- @time.to_s(:short),
213
- @time.to_s(:short)
210
+ @time.to_formatted_s(:db),
211
+ @time.to_formatted_s(:db),
212
+ @time.to_formatted_s(:short),
213
+ @time.to_formatted_s(:short)
214
214
  ].join(',')
215
215
  expect(foo).to eq(expected)
216
216
  end
@@ -246,10 +246,10 @@ describe Comma, 'to_comma data/headers object extensions' do # rubocop:disable M
246
246
  expected = [
247
247
  @content,
248
248
  @content[0..10],
249
- @time.to_s(:db),
250
- @time.to_s(:db),
251
- @time.to_s(:short),
252
- @time.to_s(:short)
249
+ @time.to_formatted_s(:db),
250
+ @time.to_formatted_s(:db),
251
+ @time.to_formatted_s(:short),
252
+ @time.to_formatted_s(:short)
253
253
  ].join(',')
254
254
  expect(header).to eq(expected)
255
255
  end
@@ -79,7 +79,7 @@ if defined? ActiveRecord
79
79
  end
80
80
 
81
81
  describe '#to_comma on scopes' do
82
- it 'should extend ActiveRecord::NamedScope::Scope to add a #to_comma method which will return CSV content for objects within the scope' do # rubocop:disable Metrics/LineLength
82
+ it 'should extend ActiveRecord::NamedScope::Scope to add a #to_comma method which will return CSV content for objects within the scope' do # rubocop:disable Layout/LineLength
83
83
  expect(Person.teenagers.to_comma).to eq "Name,Age\nJunior,18\n"
84
84
  end
85
85
 
@@ -29,7 +29,7 @@ if defined? Mongoid
29
29
  @person.save
30
30
  end
31
31
 
32
- it 'should extend ActiveRecord::NamedScope::Scope to add a #to_comma method which will return CSV content for objects within the scope' do # rubocop:disable Metrics/LineLength
32
+ it 'should extend ActiveRecord::NamedScope::Scope to add a #to_comma method which will return CSV content for objects within the scope' do # rubocop:disable Layout/LineLength
33
33
  Person.teenagers.to_comma.should == "Name,Age\nJunior,18\n"
34
34
  end
35
35