human_attributes 0.6.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +104 -0
  3. data/.circleci/setup-rubygems.sh +3 -0
  4. data/.rubocop.yml +65 -594
  5. data/.ruby-version +1 -1
  6. data/CHANGELOG.md +11 -0
  7. data/Gemfile.lock +219 -147
  8. data/Guardfile +4 -4
  9. data/README.md +127 -26
  10. data/Rakefile +1 -1
  11. data/human_attributes.gemspec +11 -7
  12. data/lib/human_attributes/config.rb +50 -68
  13. data/lib/human_attributes/engine.rb +1 -0
  14. data/lib/human_attributes/errors.rb +6 -0
  15. data/lib/human_attributes/extension.rb +21 -26
  16. data/lib/human_attributes/formatters/base.rb +1 -0
  17. data/lib/human_attributes/formatters/enum.rb +25 -0
  18. data/lib/human_attributes/formatters/enumerize.rb +1 -0
  19. data/lib/human_attributes/formatters_builder.rb +1 -0
  20. data/lib/human_attributes/version.rb +1 -1
  21. data/spec/dummy/Rakefile +1 -1
  22. data/spec/dummy/app/assets/config/manifest.js +3 -0
  23. data/spec/dummy/app/assets/stylesheets/application.css +3 -3
  24. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  25. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  26. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  27. data/spec/dummy/app/{assets/javascripts → javascript/packs}/application.js +3 -1
  28. data/spec/dummy/app/jobs/application_job.rb +7 -0
  29. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  30. data/spec/dummy/app/models/application_record.rb +3 -0
  31. data/spec/dummy/app/models/purchase.rb +20 -11
  32. data/spec/dummy/app/views/layouts/application.html.erb +10 -9
  33. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  34. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  35. data/spec/dummy/bin/rails +3 -3
  36. data/spec/dummy/bin/rake +2 -2
  37. data/spec/dummy/bin/setup +18 -14
  38. data/spec/dummy/config/application.rb +12 -22
  39. data/spec/dummy/config/boot.rb +3 -3
  40. data/spec/dummy/config/cable.yml +10 -0
  41. data/spec/dummy/config/database.yml +4 -18
  42. data/spec/dummy/config/environment.rb +1 -1
  43. data/spec/dummy/config/environments/development.rb +49 -14
  44. data/spec/dummy/config/environments/production.rb +63 -22
  45. data/spec/dummy/config/environments/test.rb +29 -12
  46. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  47. data/spec/dummy/config/initializers/assets.rb +4 -3
  48. data/spec/dummy/config/initializers/backtrace_silencers.rb +4 -3
  49. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  50. data/spec/dummy/config/initializers/cookies_serializer.rb +2 -0
  51. data/spec/dummy/config/initializers/filter_parameter_logging.rb +3 -1
  52. data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
  53. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -2
  54. data/spec/dummy/config/locales/en.yml +26 -1
  55. data/spec/dummy/config/puma.rb +43 -0
  56. data/spec/dummy/config/routes.rb +1 -54
  57. data/spec/dummy/config/storage.yml +34 -0
  58. data/spec/dummy/config.ru +3 -1
  59. data/spec/dummy/db/migrate/20161113032308_create_purchases.rb +1 -1
  60. data/spec/dummy/db/migrate/20211006145358_add_payment_method_to_purchase.rb +5 -0
  61. data/spec/dummy/db/migrate/20211103114451_add_shipping_to_purchase.rb +5 -0
  62. data/spec/dummy/db/migrate/20211103114830_add_store_to_purchase.rb +5 -0
  63. data/spec/dummy/db/schema.rb +17 -17
  64. data/spec/dummy/public/404.html +6 -6
  65. data/spec/dummy/public/422.html +6 -6
  66. data/spec/dummy/public/500.html +6 -6
  67. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  68. data/spec/dummy/public/apple-touch-icon.png +0 -0
  69. data/spec/dummy/spec/factories/purchases.rb +9 -22
  70. data/spec/dummy/spec/lib/active_record_extension_spec.rb +81 -33
  71. metadata +104 -38
  72. data/.hound.yml +0 -4
  73. data/.travis.yml +0 -15
  74. data/spec/dummy/README.rdoc +0 -28
  75. data/spec/dummy/bin/bundle +0 -3
  76. data/spec/dummy/config/initializers/session_store.rb +0 -3
  77. data/spec/dummy/config/secrets.yml +0 -22
@@ -1,9 +1,10 @@
1
1
  require "rails_helper"
2
2
  require "enumerize"
3
3
 
4
+ # rubocop:disable Lint/ConstantDefinitionInBlock
4
5
  RSpec.describe "ActiveRecordExtension" do
5
6
  after do
6
- class Purchase < ActiveRecord::Base
7
+ class Purchase < ApplicationRecord
7
8
  humanizers.each do |method|
8
9
  remove_method method
9
10
  end
@@ -15,7 +16,7 @@ RSpec.describe "ActiveRecordExtension" do
15
16
 
16
17
  it "raises error passing invalid options" do
17
18
  expect do
18
- class Purchase < ActiveRecord::Base
19
+ class Purchase < ApplicationRecord
19
20
  humanize :amount, "invalid"
20
21
  end
21
22
  end.to raise_error(HumanAttributes::Error::InvalidHumanizeConfig)
@@ -23,7 +24,7 @@ RSpec.describe "ActiveRecordExtension" do
23
24
 
24
25
  it "raises error passing multiple types" do
25
26
  expect do
26
- class Purchase < ActiveRecord::Base
27
+ class Purchase < ApplicationRecord
27
28
  humanize :amount, invalid: true
28
29
  end
29
30
  end.to raise_error(HumanAttributes::Error::InvalidType)
@@ -31,7 +32,7 @@ RSpec.describe "ActiveRecordExtension" do
31
32
 
32
33
  it "raises error passing no type" do
33
34
  expect do
34
- class Purchase < ActiveRecord::Base
35
+ class Purchase < ApplicationRecord
35
36
  humanize :amount, {}
36
37
  end
37
38
  end.to raise_error(HumanAttributes::Error::RequiredAttributeType)
@@ -39,7 +40,7 @@ RSpec.describe "ActiveRecordExtension" do
39
40
 
40
41
  it "raises error trying to pass invalid options" do
41
42
  expect do
42
- class Purchase < ActiveRecord::Base
43
+ class Purchase < ApplicationRecord
43
44
  humanize :amount, currency: "invalid"
44
45
  end
45
46
  end.to raise_error(HumanAttributes::Error::InvalidAttributeOptions)
@@ -47,7 +48,7 @@ RSpec.describe "ActiveRecordExtension" do
47
48
 
48
49
  context "with default value" do
49
50
  before do
50
- class Purchase < ActiveRecord::Base
51
+ class Purchase < ApplicationRecord
51
52
  humanize :amount, currency: { default: 666 }
52
53
  end
53
54
 
@@ -59,7 +60,7 @@ RSpec.describe "ActiveRecordExtension" do
59
60
 
60
61
  context "with default value" do
61
62
  before do
62
- class Purchase < ActiveRecord::Base
63
+ class Purchase < ApplicationRecord
63
64
  humanize :amount, percentage: { suffix: true }, currency: { suffix: true }
64
65
  end
65
66
 
@@ -75,7 +76,7 @@ RSpec.describe "ActiveRecordExtension" do
75
76
 
76
77
  context "with default suffix" do
77
78
  before do
78
- class Purchase < ActiveRecord::Base
79
+ class Purchase < ApplicationRecord
79
80
  humanize :amount, currency: { suffix: true }
80
81
  end
81
82
  end
@@ -85,7 +86,7 @@ RSpec.describe "ActiveRecordExtension" do
85
86
 
86
87
  context "with custom suffix" do
87
88
  before do
88
- class Purchase < ActiveRecord::Base
89
+ class Purchase < ApplicationRecord
89
90
  humanize :amount, currency: { suffix: "to_cur" }
90
91
  end
91
92
  end
@@ -102,7 +103,7 @@ RSpec.describe "ActiveRecordExtension" do
102
103
 
103
104
  context "with no options" do
104
105
  before do
105
- class Purchase < ActiveRecord::Base
106
+ class Purchase < ApplicationRecord
106
107
  humanize :amount, currency: true
107
108
  end
108
109
  end
@@ -112,7 +113,7 @@ RSpec.describe "ActiveRecordExtension" do
112
113
 
113
114
  context "with valid options" do
114
115
  before do
115
- class Purchase < ActiveRecord::Base
116
+ class Purchase < ApplicationRecord
116
117
  humanize :amount, currency: { unit: "R$", separator: ",", delimiter: " " }
117
118
  end
118
119
  end
@@ -122,7 +123,7 @@ RSpec.describe "ActiveRecordExtension" do
122
123
 
123
124
  context "with multiple attributes" do
124
125
  before do
125
- class Purchase < ActiveRecord::Base
126
+ class Purchase < ApplicationRecord
126
127
  humanize :amount, :commission, currency: true
127
128
  end
128
129
  end
@@ -133,7 +134,7 @@ RSpec.describe "ActiveRecordExtension" do
133
134
 
134
135
  context "with calculated attributes (instance methods)" do
135
136
  before do
136
- class Purchase < ActiveRecord::Base
137
+ class Purchase < ApplicationRecord
137
138
  humanize :commission_amount, currency: true
138
139
 
139
140
  def commission_amount
@@ -151,7 +152,7 @@ RSpec.describe "ActiveRecordExtension" do
151
152
 
152
153
  context "with number type" do
153
154
  before do
154
- class Purchase < ActiveRecord::Base
155
+ class Purchase < ApplicationRecord
155
156
  humanize :quantity, number: true
156
157
  end
157
158
  end
@@ -161,7 +162,7 @@ RSpec.describe "ActiveRecordExtension" do
161
162
 
162
163
  context "with size type" do
163
164
  before do
164
- class Purchase < ActiveRecord::Base
165
+ class Purchase < ApplicationRecord
165
166
  humanize :quantity, size: true
166
167
  end
167
168
  end
@@ -171,7 +172,7 @@ RSpec.describe "ActiveRecordExtension" do
171
172
 
172
173
  context "with percentage type" do
173
174
  before do
174
- class Purchase < ActiveRecord::Base
175
+ class Purchase < ApplicationRecord
175
176
  humanize :quantity, percentage: true
176
177
  end
177
178
  end
@@ -183,7 +184,7 @@ RSpec.describe "ActiveRecordExtension" do
183
184
 
184
185
  context "with phone type" do
185
186
  before do
186
- class Purchase < ActiveRecord::Base
187
+ class Purchase < ApplicationRecord
187
188
  humanize :quantity, phone: true
188
189
  end
189
190
  end
@@ -193,7 +194,7 @@ RSpec.describe "ActiveRecordExtension" do
193
194
 
194
195
  context "with delimiter type" do
195
196
  before do
196
- class Purchase < ActiveRecord::Base
197
+ class Purchase < ApplicationRecord
197
198
  humanize :quantity, delimiter: true
198
199
  end
199
200
  end
@@ -203,7 +204,7 @@ RSpec.describe "ActiveRecordExtension" do
203
204
 
204
205
  context "with precision type" do
205
206
  before do
206
- class Purchase < ActiveRecord::Base
207
+ class Purchase < ApplicationRecord
207
208
  humanize :quantity, precision: true
208
209
  end
209
210
  end
@@ -217,7 +218,7 @@ RSpec.describe "ActiveRecordExtension" do
217
218
 
218
219
  context "passing true value" do
219
220
  before do
220
- class Purchase < ActiveRecord::Base
221
+ class Purchase < ApplicationRecord
221
222
  humanize :paid, boolean: true
222
223
  end
223
224
  end
@@ -229,7 +230,7 @@ RSpec.describe "ActiveRecordExtension" do
229
230
  before do
230
231
  purchase.paid = false
231
232
 
232
- class Purchase < ActiveRecord::Base
233
+ class Purchase < ApplicationRecord
233
234
  humanize :paid, boolean: true
234
235
  end
235
236
  end
@@ -241,7 +242,7 @@ RSpec.describe "ActiveRecordExtension" do
241
242
  context "with custom formatter" do
242
243
  it "raises error with missing formatter option" do
243
244
  expect do
244
- class Purchase < ActiveRecord::Base
245
+ class Purchase < ApplicationRecord
245
246
  humanize :id, custom: true
246
247
  end
247
248
  end.to raise_error(HumanAttributes::Error::MissingFormatterOption)
@@ -252,7 +253,7 @@ RSpec.describe "ActiveRecordExtension" do
252
253
  purchase.id = 1
253
254
  purchase.paid = true
254
255
 
255
- class Purchase < ActiveRecord::Base
256
+ class Purchase < ApplicationRecord
256
257
  humanize :id, custom: { formatter: ->(purchase, value) { "#{value}:#{purchase.paid}" } }
257
258
  end
258
259
  end
@@ -264,7 +265,7 @@ RSpec.describe "ActiveRecordExtension" do
264
265
  context "with Enumerize attribute" do
265
266
  context "passing valid value" do
266
267
  before do
267
- class Purchase < ActiveRecord::Base
268
+ class Purchase < ApplicationRecord
268
269
  extend Enumerize
269
270
  enumerize :state, in: %i{canceled finished}
270
271
  humanize :state, enumerize: true
@@ -278,7 +279,7 @@ RSpec.describe "ActiveRecordExtension" do
278
279
 
279
280
  context "passing no enum value" do
280
281
  before do
281
- class Purchase < ActiveRecord::Base
282
+ class Purchase < ApplicationRecord
282
283
  extend Enumerize
283
284
  humanize :quantity, enumerize: true
284
285
  end
@@ -292,13 +293,56 @@ RSpec.describe "ActiveRecordExtension" do
292
293
  end
293
294
  end
294
295
 
295
- context "with date and datetime formats" do
296
+ context "with Enum attributes" do
297
+ context "with attribute translation" do
298
+ before do
299
+ class Purchase < ApplicationRecord
300
+ humanize :payment_method, enum: true
301
+ end
302
+ end
303
+
304
+ it { expect(purchase.human_payment_method).to eq("Debit Card") }
305
+ end
306
+ context "with enum default translation" do
307
+ before do
308
+ class Purchase < ApplicationRecord
309
+ humanize :shipping, enum: true
310
+ end
311
+ end
312
+
313
+ it { expect(purchase.human_shipping).to eq("Express") }
314
+ end
315
+ context "without translation" do
316
+ before do
317
+ class Purchase < ApplicationRecord
318
+ humanize :store, enum: true
319
+ end
320
+ end
321
+
322
+ it { expect(purchase.human_store).to eq("online") }
323
+ end
324
+ context "with no enum value" do
325
+ before do
326
+ class Purchase < ApplicationRecord
327
+ humanize :quantity, enum: true
328
+ end
329
+ end
330
+
331
+ it do
332
+ expect { purchase.human_quantity }.to(
333
+ raise_error(HumanAttributes::Error::NotEnumAttribute)
334
+ )
335
+ end
336
+ end
337
+ end
338
+
339
+ context "with date and datetime format" do
296
340
  before { purchase.expired_at = "04/06/1984 09:20:00" }
297
341
  before { purchase.created_at = "04/06/1985 09:20:00" }
298
342
 
299
343
  context "passing custom format" do
300
344
  before do
301
- class Purchase < ActiveRecord::Base
345
+ class Purchase < ApplicationRecord
302
346
  humanize :expired_at, date: { format: "%Y" }
303
347
  humanize :created_at, datetime: { format: "%Y" }
304
348
  end
@@ -310,7 +354,7 @@ RSpec.describe "ActiveRecordExtension" do
310
354
 
311
355
  context "without options" do
312
356
  before do
313
- class Purchase < ActiveRecord::Base
357
+ class Purchase < ApplicationRecord
314
358
  humanize :expired_at, date: true
315
359
  humanize :created_at, datetime: true
316
360
  end
@@ -322,7 +366,7 @@ RSpec.describe "ActiveRecordExtension" do
322
366
 
323
367
  context "with short format" do
324
368
  before do
325
- class Purchase < ActiveRecord::Base
369
+ class Purchase < ApplicationRecord
326
370
  humanize :expired_at, date: { format: :short }
327
371
  humanize :created_at, datetime: { format: :short }
328
372
  end
@@ -334,7 +378,7 @@ RSpec.describe "ActiveRecordExtension" do
334
378
 
335
379
  context "with long format" do
336
380
  before do
337
- class Purchase < ActiveRecord::Base
381
+ class Purchase < ApplicationRecord
338
382
  humanize :expired_at, date: { format: :long }
339
383
  humanize :created_at, datetime: { format: :long }
340
384
  end
@@ -351,7 +395,7 @@ RSpec.describe "ActiveRecordExtension" do
351
395
 
352
396
  context "without options" do
353
397
  before do
354
- class Purchase < ActiveRecord::Base
398
+ class Purchase < ApplicationRecord
355
399
  humanize_attributes
356
400
  end
357
401
  end
@@ -363,6 +407,9 @@ RSpec.describe "ActiveRecordExtension" do
363
407
  it { expect(purchase.human_amount).to eq("2,000,000.95") }
364
408
  it { expect(purchase.human_expired_at).to eq("Fri, 06 Apr 1984 09:00:00 +0000") }
365
409
  it { expect(purchase.expired_at_to_short_datetime).to eq("06 Apr 09:00") }
410
+ it { expect(purchase.human_payment_method).to eq("Debit Card") }
411
+ it { expect(purchase.human_shipping).to eq("Express") }
412
+ it { expect(purchase.human_store).to eq("online") }
366
413
  it { expect(purchase).to respond_to(:human_created_at) }
367
414
  it { expect(purchase).to respond_to(:created_at_to_short_datetime) }
368
415
  it { expect(purchase).to respond_to(:human_updated_at) }
@@ -371,7 +418,7 @@ RSpec.describe "ActiveRecordExtension" do
371
418
 
372
419
  context "with only option" do
373
420
  before do
374
- class Purchase < ActiveRecord::Base
421
+ class Purchase < ApplicationRecord
375
422
  humanize_attributes only: [:id, :paid, :amount]
376
423
  end
377
424
  end
@@ -391,7 +438,7 @@ RSpec.describe "ActiveRecordExtension" do
391
438
 
392
439
  context "with except option" do
393
440
  before do
394
- class Purchase < ActiveRecord::Base
441
+ class Purchase < ApplicationRecord
395
442
  humanize_attributes except: [:id, :paid, :amount]
396
443
  end
397
444
  end
@@ -410,3 +457,4 @@ RSpec.describe "ActiveRecordExtension" do
410
457
  end
411
458
  end
412
459
  end
460
+ # rubocop:enable Lint/ConstantDefinitionInBlock
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: human_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platanus
@@ -9,8 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-03-12 00:00:00.000000000 Z
12
+ date: 2022-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: factory_bot
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: rails
16
30
  requirement: !ruby/object:Gem::Requirement
@@ -26,13 +40,13 @@ dependencies:
26
40
  - !ruby/object:Gem::Version
27
41
  version: 4.2.0
28
42
  - !ruby/object:Gem::Dependency
29
- name: factory_bot
43
+ name: coveralls
30
44
  requirement: !ruby/object:Gem::Requirement
31
45
  requirements:
32
46
  - - ">="
33
47
  - !ruby/object:Gem::Version
34
48
  version: '0'
35
- type: :runtime
49
+ type: :development
36
50
  prerelease: false
37
51
  version_requirements: !ruby/object:Gem::Requirement
38
52
  requirements:
@@ -40,39 +54,47 @@ dependencies:
40
54
  - !ruby/object:Gem::Version
41
55
  version: '0'
42
56
  - !ruby/object:Gem::Dependency
43
- name: enumerize
57
+ name: draper
44
58
  requirement: !ruby/object:Gem::Requirement
45
59
  requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '1'
49
60
  - - ">="
50
61
  - !ruby/object:Gem::Version
51
- version: 1.1.1
62
+ version: '0'
52
63
  type: :development
53
64
  prerelease: false
54
65
  version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: enumerize
72
+ requirement: !ruby/object:Gem::Requirement
55
73
  requirements:
56
74
  - - "~>"
57
75
  - !ruby/object:Gem::Version
58
- version: '1'
59
- - - ">="
76
+ version: '2.1'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
60
82
  - !ruby/object:Gem::Version
61
- version: 1.1.1
83
+ version: '2.1'
62
84
  - !ruby/object:Gem::Dependency
63
- name: draper
85
+ name: guard-rspec
64
86
  requirement: !ruby/object:Gem::Requirement
65
87
  requirements:
66
88
  - - "~>"
67
89
  - !ruby/object:Gem::Version
68
- version: 2.1.0
90
+ version: '4.7'
69
91
  type: :development
70
92
  prerelease: false
71
93
  version_requirements: !ruby/object:Gem::Requirement
72
94
  requirements:
73
95
  - - "~>"
74
96
  - !ruby/object:Gem::Version
75
- version: 2.1.0
97
+ version: '4.7'
76
98
  - !ruby/object:Gem::Dependency
77
99
  name: pry
78
100
  requirement: !ruby/object:Gem::Requirement
@@ -102,7 +124,7 @@ dependencies:
102
124
  - !ruby/object:Gem::Version
103
125
  version: '0'
104
126
  - !ruby/object:Gem::Dependency
105
- name: sqlite3
127
+ name: rspec_junit_formatter
106
128
  requirement: !ruby/object:Gem::Requirement
107
129
  requirements:
108
130
  - - ">="
@@ -119,32 +141,46 @@ dependencies:
119
141
  name: rspec-rails
120
142
  requirement: !ruby/object:Gem::Requirement
121
143
  requirements:
122
- - - "~>"
144
+ - - ">="
123
145
  - !ruby/object:Gem::Version
124
- version: '3.4'
146
+ version: '0'
125
147
  type: :development
126
148
  prerelease: false
127
149
  version_requirements: !ruby/object:Gem::Requirement
128
150
  requirements:
129
- - - "~>"
151
+ - - ">="
130
152
  - !ruby/object:Gem::Version
131
- version: '3.4'
153
+ version: '0'
132
154
  - !ruby/object:Gem::Dependency
133
- name: guard-rspec
155
+ name: rubocop
134
156
  requirement: !ruby/object:Gem::Requirement
135
157
  requirements:
136
158
  - - "~>"
137
159
  - !ruby/object:Gem::Version
138
- version: '4.7'
160
+ version: '1.9'
139
161
  type: :development
140
162
  prerelease: false
141
163
  version_requirements: !ruby/object:Gem::Requirement
142
164
  requirements:
143
165
  - - "~>"
144
166
  - !ruby/object:Gem::Version
145
- version: '4.7'
167
+ version: '1.9'
146
168
  - !ruby/object:Gem::Dependency
147
- name: coveralls
169
+ name: rubocop-rails
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ type: :development
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ - !ruby/object:Gem::Dependency
183
+ name: sqlite3
148
184
  requirement: !ruby/object:Gem::Requirement
149
185
  requirements:
150
186
  - - ">="
@@ -166,13 +202,13 @@ executables: []
166
202
  extensions: []
167
203
  extra_rdoc_files: []
168
204
  files:
205
+ - ".circleci/config.yml"
206
+ - ".circleci/setup-rubygems.sh"
169
207
  - ".coveralls.yml"
170
208
  - ".gitignore"
171
- - ".hound.yml"
172
209
  - ".rspec"
173
210
  - ".rubocop.yml"
174
211
  - ".ruby-version"
175
- - ".travis.yml"
176
212
  - CHANGELOG.md
177
213
  - Gemfile
178
214
  - Gemfile.lock
@@ -191,49 +227,65 @@ files:
191
227
  - lib/human_attributes/formatters/custom.rb
192
228
  - lib/human_attributes/formatters/date.rb
193
229
  - lib/human_attributes/formatters/datetime.rb
230
+ - lib/human_attributes/formatters/enum.rb
194
231
  - lib/human_attributes/formatters/enumerize.rb
195
232
  - lib/human_attributes/formatters/numeric.rb
196
233
  - lib/human_attributes/formatters_builder.rb
197
234
  - lib/human_attributes/method_builder.rb
198
235
  - lib/human_attributes/version.rb
199
236
  - lib/tasks/human_attributes_tasks.rake
200
- - spec/dummy/README.rdoc
201
237
  - spec/dummy/Rakefile
202
- - spec/dummy/app/assets/javascripts/application.js
238
+ - spec/dummy/app/assets/config/manifest.js
203
239
  - spec/dummy/app/assets/stylesheets/application.css
240
+ - spec/dummy/app/channels/application_cable/channel.rb
241
+ - spec/dummy/app/channels/application_cable/connection.rb
204
242
  - spec/dummy/app/controllers/application_controller.rb
205
243
  - spec/dummy/app/decorators/purchase_decorator.rb
206
244
  - spec/dummy/app/helpers/application_helper.rb
245
+ - spec/dummy/app/javascript/packs/application.js
246
+ - spec/dummy/app/jobs/application_job.rb
247
+ - spec/dummy/app/mailers/application_mailer.rb
248
+ - spec/dummy/app/models/application_record.rb
207
249
  - spec/dummy/app/models/purchase.rb
208
250
  - spec/dummy/app/views/layouts/application.html.erb
209
- - spec/dummy/bin/bundle
251
+ - spec/dummy/app/views/layouts/mailer.html.erb
252
+ - spec/dummy/app/views/layouts/mailer.text.erb
210
253
  - spec/dummy/bin/rails
211
254
  - spec/dummy/bin/rake
212
255
  - spec/dummy/bin/setup
213
256
  - spec/dummy/config.ru
214
257
  - spec/dummy/config/application.rb
215
258
  - spec/dummy/config/boot.rb
259
+ - spec/dummy/config/cable.yml
216
260
  - spec/dummy/config/database.yml
217
261
  - spec/dummy/config/environment.rb
218
262
  - spec/dummy/config/environments/development.rb
219
263
  - spec/dummy/config/environments/production.rb
220
264
  - spec/dummy/config/environments/test.rb
265
+ - spec/dummy/config/initializers/application_controller_renderer.rb
221
266
  - spec/dummy/config/initializers/assets.rb
222
267
  - spec/dummy/config/initializers/backtrace_silencers.rb
268
+ - spec/dummy/config/initializers/content_security_policy.rb
223
269
  - spec/dummy/config/initializers/cookies_serializer.rb
224
270
  - spec/dummy/config/initializers/filter_parameter_logging.rb
225
271
  - spec/dummy/config/initializers/inflections.rb
226
272
  - spec/dummy/config/initializers/mime_types.rb
227
- - spec/dummy/config/initializers/session_store.rb
273
+ - spec/dummy/config/initializers/permissions_policy.rb
228
274
  - spec/dummy/config/initializers/wrap_parameters.rb
229
275
  - spec/dummy/config/locales/en.yml
276
+ - spec/dummy/config/puma.rb
230
277
  - spec/dummy/config/routes.rb
231
- - spec/dummy/config/secrets.yml
278
+ - spec/dummy/config/storage.yml
232
279
  - spec/dummy/db/migrate/20161113032308_create_purchases.rb
280
+ - spec/dummy/db/migrate/20211006145358_add_payment_method_to_purchase.rb
281
+ - spec/dummy/db/migrate/20211103114451_add_shipping_to_purchase.rb
282
+ - spec/dummy/db/migrate/20211103114830_add_store_to_purchase.rb
233
283
  - spec/dummy/db/schema.rb
234
284
  - spec/dummy/public/404.html
235
285
  - spec/dummy/public/422.html
236
286
  - spec/dummy/public/500.html
287
+ - spec/dummy/public/apple-touch-icon-precomposed.png
288
+ - spec/dummy/public/apple-touch-icon.png
237
289
  - spec/dummy/public/favicon.ico
238
290
  - spec/dummy/spec/assets/image.png
239
291
  - spec/dummy/spec/assets/video.mp4
@@ -261,49 +313,63 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
313
  - !ruby/object:Gem::Version
262
314
  version: '0'
263
315
  requirements: []
264
- rubyforge_project:
265
- rubygems_version: 2.7.6
316
+ rubygems_version: 3.1.6
266
317
  signing_key:
267
318
  specification_version: 4
268
319
  summary: Gem to generate human readable ActiveRecord attributes
269
320
  test_files:
270
- - spec/dummy/README.rdoc
271
321
  - spec/dummy/Rakefile
272
- - spec/dummy/app/assets/javascripts/application.js
322
+ - spec/dummy/app/assets/config/manifest.js
273
323
  - spec/dummy/app/assets/stylesheets/application.css
324
+ - spec/dummy/app/channels/application_cable/channel.rb
325
+ - spec/dummy/app/channels/application_cable/connection.rb
274
326
  - spec/dummy/app/controllers/application_controller.rb
275
327
  - spec/dummy/app/decorators/purchase_decorator.rb
276
328
  - spec/dummy/app/helpers/application_helper.rb
329
+ - spec/dummy/app/javascript/packs/application.js
330
+ - spec/dummy/app/jobs/application_job.rb
331
+ - spec/dummy/app/mailers/application_mailer.rb
332
+ - spec/dummy/app/models/application_record.rb
277
333
  - spec/dummy/app/models/purchase.rb
278
334
  - spec/dummy/app/views/layouts/application.html.erb
279
- - spec/dummy/bin/bundle
335
+ - spec/dummy/app/views/layouts/mailer.html.erb
336
+ - spec/dummy/app/views/layouts/mailer.text.erb
280
337
  - spec/dummy/bin/rails
281
338
  - spec/dummy/bin/rake
282
339
  - spec/dummy/bin/setup
283
340
  - spec/dummy/config.ru
284
341
  - spec/dummy/config/application.rb
285
342
  - spec/dummy/config/boot.rb
343
+ - spec/dummy/config/cable.yml
286
344
  - spec/dummy/config/database.yml
287
345
  - spec/dummy/config/environment.rb
288
346
  - spec/dummy/config/environments/development.rb
289
347
  - spec/dummy/config/environments/production.rb
290
348
  - spec/dummy/config/environments/test.rb
349
+ - spec/dummy/config/initializers/application_controller_renderer.rb
291
350
  - spec/dummy/config/initializers/assets.rb
292
351
  - spec/dummy/config/initializers/backtrace_silencers.rb
352
+ - spec/dummy/config/initializers/content_security_policy.rb
293
353
  - spec/dummy/config/initializers/cookies_serializer.rb
294
354
  - spec/dummy/config/initializers/filter_parameter_logging.rb
295
355
  - spec/dummy/config/initializers/inflections.rb
296
356
  - spec/dummy/config/initializers/mime_types.rb
297
- - spec/dummy/config/initializers/session_store.rb
357
+ - spec/dummy/config/initializers/permissions_policy.rb
298
358
  - spec/dummy/config/initializers/wrap_parameters.rb
299
359
  - spec/dummy/config/locales/en.yml
360
+ - spec/dummy/config/puma.rb
300
361
  - spec/dummy/config/routes.rb
301
- - spec/dummy/config/secrets.yml
362
+ - spec/dummy/config/storage.yml
302
363
  - spec/dummy/db/migrate/20161113032308_create_purchases.rb
364
+ - spec/dummy/db/migrate/20211006145358_add_payment_method_to_purchase.rb
365
+ - spec/dummy/db/migrate/20211103114451_add_shipping_to_purchase.rb
366
+ - spec/dummy/db/migrate/20211103114830_add_store_to_purchase.rb
303
367
  - spec/dummy/db/schema.rb
304
368
  - spec/dummy/public/404.html
305
369
  - spec/dummy/public/422.html
306
370
  - spec/dummy/public/500.html
371
+ - spec/dummy/public/apple-touch-icon-precomposed.png
372
+ - spec/dummy/public/apple-touch-icon.png
307
373
  - spec/dummy/public/favicon.ico
308
374
  - spec/dummy/spec/assets/image.png
309
375
  - spec/dummy/spec/assets/video.mp4
data/.hound.yml DELETED
@@ -1,4 +0,0 @@
1
- ---
2
- ruby:
3
- enabled: true
4
- config_file: ".rubocop.yml"