solidus_volume_pricing 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +50 -12
  3. data/.gem_release.yml +5 -0
  4. data/.github/dependabot.yml +7 -0
  5. data/.github/stale.yml +1 -0
  6. data/.github_changelog_generator +2 -0
  7. data/.gitignore +15 -7
  8. data/.rspec +1 -2
  9. data/.rubocop.yml +2 -7
  10. data/.rubocop_todo.yml +18 -76
  11. data/CHANGELOG.md +1 -55
  12. data/Gemfile +26 -12
  13. data/{LICENSE.md → LICENSE} +2 -2
  14. data/OLD_CHANGELOG.md +86 -0
  15. data/README.md +5 -5
  16. data/Rakefile +4 -19
  17. data/app/controllers/spree/admin/volume_price_models_controller.rb +1 -1
  18. data/app/decorators/models/solidus_volume_pricing/spree/variant_decorator.rb +6 -4
  19. data/app/models/spree/volume_price.rb +41 -41
  20. data/app/models/spree/volume_price_model.rb +9 -7
  21. data/app/views/spree/admin/volume_prices/_volume_price_fields.html.erb +5 -3
  22. data/bin/console +17 -0
  23. data/bin/rails +5 -6
  24. data/bin/rails-engine +13 -0
  25. data/bin/rails-sandbox +16 -0
  26. data/bin/rake +7 -0
  27. data/bin/sandbox +78 -0
  28. data/bin/setup +8 -0
  29. data/db/migrate/20150603143015_create_spree_volume_price_models.rb +1 -0
  30. data/lib/generators/solidus_volume_pricing/install/install_generator.rb +8 -4
  31. data/lib/solidus_volume_pricing/engine.rb +13 -3
  32. data/{spec/factories/volume_price_factory.rb → lib/solidus_volume_pricing/testing_support/factories.rb} +2 -2
  33. data/lib/solidus_volume_pricing/version.rb +1 -16
  34. data/lib/solidus_volume_pricing.rb +1 -0
  35. data/solidus_volume_pricing.gemspec +38 -29
  36. data/spec/controllers/spree/admin/variants_controller_spec.rb +1 -1
  37. data/spec/features/manage_volume_price_models_feature_spec.rb +3 -7
  38. data/spec/features/manage_volume_prices_feature_spec.rb +6 -7
  39. data/spec/lib/solidus_volume_pricing/range_from_string_spec.rb +2 -2
  40. data/spec/models/solidus_volume_pricing/pricer_spec.rb +0 -4
  41. data/spec/models/spree/line_item_spec.rb +0 -1
  42. data/spec/models/spree/volume_price_spec.rb +1 -10
  43. data/spec/spec_helper.rb +26 -5
  44. metadata +98 -30
  45. data/app/decorators/models/solidus_volume_pricing/spree/user_decorator.rb +0 -17
data/spec/spec_helper.rb CHANGED
@@ -1,11 +1,32 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ENV['RAILS_ENV'] ||= 'test'
3
+ # Configure Rails Environment
4
+ ENV['RAILS_ENV'] = 'test'
4
5
 
5
- require 'solidus_extension_dev_tools/rspec/coverage'
6
+ # Run Coverage report
7
+ require 'solidus_dev_support/rspec/coverage'
6
8
 
7
- require File.expand_path('dummy/config/environment.rb', __dir__)
9
+ # Create the dummy app if it's still missing.
10
+ dummy_env = "#{__dir__}/dummy/config/environment.rb"
11
+ system 'bin/rake extension:test_app' unless File.exist? dummy_env
12
+ require dummy_env
8
13
 
9
- require 'solidus_extension_dev_tools/rspec/feature_helper'
14
+ # Requires factories and other useful helpers defined in spree_core.
15
+ require 'solidus_dev_support/rspec/feature_helper'
10
16
 
11
- Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
17
+ # Requires supporting ruby files with custom matchers and macros, etc,
18
+ # in spec/support/ and its subdirectories.
19
+ Dir["#{__dir__}/support/**/*.rb"].sort.each { |f| require f }
20
+
21
+ # Requires factories defined in Solidus core and this extension.
22
+ # See: lib/solidus_volume_pricing/testing_support/factories.rb
23
+ SolidusDevSupport::TestingSupport::Factories.load_for(SolidusVolumePricing::Engine)
24
+
25
+ RSpec.configure do |config|
26
+ config.infer_spec_type_from_file_location!
27
+ config.use_transactional_fixtures = false
28
+
29
+ if Spree.solidus_gem_version < Gem::Version.new('2.11')
30
+ config.extend Spree::TestingSupport::AuthorizationHelpers::Request, type: :system
31
+ end
32
+ end
metadata CHANGED
@@ -1,65 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_volume_pricing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
- autorequire:
9
- bindir: bin
8
+ autorequire:
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-25 00:00:00.000000000 Z
11
+ date: 2023-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: deface
14
+ name: solidus_backend
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: 2.4.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '1.0'
29
+ version: 2.4.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5'
27
33
  - !ruby/object:Gem::Dependency
28
- name: solidus_backend
34
+ name: coffee-rails
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: '2.0'
39
+ version: '0'
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
- version: '2.0'
46
+ version: '0'
41
47
  - !ruby/object:Gem::Dependency
42
- name: solidus_core
48
+ name: deface
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
51
  - - ">="
46
52
  - !ruby/object:Gem::Version
47
- version: '2.0'
53
+ version: '0'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
58
  - - ">="
53
59
  - !ruby/object:Gem::Version
54
- version: '2.0'
60
+ version: '0'
55
61
  - !ruby/object:Gem::Dependency
56
- name: shoulda-matchers
62
+ name: sassc-rails
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - ">="
60
66
  - !ruby/object:Gem::Version
61
67
  version: '0'
62
- type: :development
68
+ type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
@@ -67,7 +73,41 @@ dependencies:
67
73
  - !ruby/object:Gem::Version
68
74
  version: '0'
69
75
  - !ruby/object:Gem::Dependency
70
- name: solidus_extension_dev_tools
76
+ name: solidus_core
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 2.0.0
82
+ - - "<"
83
+ - !ruby/object:Gem::Version
84
+ version: '5'
85
+ type: :runtime
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: 2.0.0
92
+ - - "<"
93
+ - !ruby/object:Gem::Version
94
+ version: '5'
95
+ - !ruby/object:Gem::Dependency
96
+ name: solidus_support
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '0.8'
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - "~>"
107
+ - !ruby/object:Gem::Version
108
+ version: '0.8'
109
+ - !ruby/object:Gem::Dependency
110
+ name: shoulda-matchers
71
111
  requirement: !ruby/object:Gem::Requirement
72
112
  requirements:
73
113
  - - ">="
@@ -80,6 +120,20 @@ dependencies:
80
120
  - - ">="
81
121
  - !ruby/object:Gem::Version
82
122
  version: '0'
123
+ - !ruby/object:Gem::Dependency
124
+ name: solidus_dev_support
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '2.6'
130
+ type: :development
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: '2.6'
83
137
  description: Allow prices to be configured in quantity ranges for each variant
84
138
  email: sean@railsdog.com
85
139
  executables: []
@@ -87,6 +141,10 @@ extensions: []
87
141
  extra_rdoc_files: []
88
142
  files:
89
143
  - ".circleci/config.yml"
144
+ - ".gem_release.yml"
145
+ - ".github/dependabot.yml"
146
+ - ".github/stale.yml"
147
+ - ".github_changelog_generator"
90
148
  - ".gitignore"
91
149
  - ".rspec"
92
150
  - ".rubocop.yml"
@@ -94,7 +152,8 @@ files:
94
152
  - CHANGELOG.md
95
153
  - Gemfile
96
154
  - Guardfile
97
- - LICENSE.md
155
+ - LICENSE
156
+ - OLD_CHANGELOG.md
98
157
  - README.md
99
158
  - Rakefile
100
159
  - app/assets/javascripts/spree/backend/solidus_volume_pricing.js
@@ -103,7 +162,6 @@ files:
103
162
  - app/decorators/controllers/solidus_volume_pricing/spree/admin/variants_controller_decorator.rb
104
163
  - app/decorators/helpers/solidus_volume_pricing/spree/base_helper_decorator.rb
105
164
  - app/decorators/models/solidus_volume_pricing/spree/line_item_decorator.rb
106
- - app/decorators/models/solidus_volume_pricing/spree/user_decorator.rb
107
165
  - app/decorators/models/solidus_volume_pricing/spree/variant_decorator.rb
108
166
  - app/models/solidus_volume_pricing/price_display.rb
109
167
  - app/models/solidus_volume_pricing/pricer.rb
@@ -124,7 +182,13 @@ files:
124
182
  - app/views/spree/admin/volume_prices/_table.html.erb
125
183
  - app/views/spree/admin/volume_prices/_volume_price_fields.html.erb
126
184
  - app/views/spree/products/_volume_pricing.html.erb
185
+ - bin/console
127
186
  - bin/rails
187
+ - bin/rails-engine
188
+ - bin/rails-sandbox
189
+ - bin/rake
190
+ - bin/sandbox
191
+ - bin/setup
128
192
  - config/locales/de.yml
129
193
  - config/locales/en.yml
130
194
  - config/locales/pt.yml
@@ -142,10 +206,10 @@ files:
142
206
  - lib/solidus_volume_pricing.rb
143
207
  - lib/solidus_volume_pricing/engine.rb
144
208
  - lib/solidus_volume_pricing/range_from_string.rb
209
+ - lib/solidus_volume_pricing/testing_support/factories.rb
145
210
  - lib/solidus_volume_pricing/version.rb
146
211
  - solidus_volume_pricing.gemspec
147
212
  - spec/controllers/spree/admin/variants_controller_spec.rb
148
- - spec/factories/volume_price_factory.rb
149
213
  - spec/features/manage_volume_price_models_feature_spec.rb
150
214
  - spec/features/manage_volume_prices_feature_spec.rb
151
215
  - spec/helpers/base_helper_spec.rb
@@ -160,9 +224,12 @@ files:
160
224
  - spec/support/shoulda.rb
161
225
  homepage: https://github.com/solidusio-contrib/solidus_volume_pricing
162
226
  licenses:
163
- - BSD-3
164
- metadata: {}
165
- post_install_message:
227
+ - BSD-3-Clause
228
+ metadata:
229
+ homepage_uri: https://github.com/solidusio-contrib/solidus_volume_pricing
230
+ source_code_uri: https://github.com/solidusio-contrib/solidus_volume_pricing
231
+ changelog_uri: https://github.com/solidusio-contrib/solidus_volume_pricing/releases
232
+ post_install_message:
166
233
  rdoc_options: []
167
234
  require_paths:
168
235
  - lib
@@ -170,21 +237,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
237
  requirements:
171
238
  - - ">="
172
239
  - !ruby/object:Gem::Version
173
- version: 2.2.3
240
+ version: '2.5'
241
+ - - "<"
242
+ - !ruby/object:Gem::Version
243
+ version: '4'
174
244
  required_rubygems_version: !ruby/object:Gem::Requirement
175
245
  requirements:
176
246
  - - ">="
177
247
  - !ruby/object:Gem::Version
178
248
  version: '0'
179
- requirements:
180
- - none
181
- rubygems_version: 3.0.6
182
- signing_key:
249
+ requirements: []
250
+ rubygems_version: 3.3.7
251
+ signing_key:
183
252
  specification_version: 4
184
253
  summary: Allow prices to be configured in quantity ranges for each variant
185
254
  test_files:
186
255
  - spec/controllers/spree/admin/variants_controller_spec.rb
187
- - spec/factories/volume_price_factory.rb
188
256
  - spec/features/manage_volume_price_models_feature_spec.rb
189
257
  - spec/features/manage_volume_prices_feature_spec.rb
190
258
  - spec/helpers/base_helper_spec.rb
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module SolidusVolumePricing
4
- module Spree
5
- module UserDecorator
6
- def resolve_role
7
- if has_spree_role? ::Spree::Config.volume_pricing_role.to_sym
8
- ::Spree::Role.find_by name: ::Spree::Config.volume_pricing_role
9
- else
10
- ::Spree::Role.find_by name: 'user'
11
- end
12
- end
13
-
14
- ::Spree.user_class.prepend self
15
- end
16
- end
17
- end