solidus_dev_support 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +35 -0
  3. data/.github/PULL_REQUEST_TEMPLATE.md +11 -0
  4. data/.github/stale.yml +17 -0
  5. data/.gitignore +12 -0
  6. data/.rspec +3 -0
  7. data/.rubocop-https---relaxed-ruby-style-rubocop-yml +174 -0
  8. data/.rubocop.yml +2 -0
  9. data/CHANGELOG.md +39 -0
  10. data/Gemfile +8 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +154 -0
  13. data/Rakefile +8 -0
  14. data/bin/console +15 -0
  15. data/bin/setup +8 -0
  16. data/exe/solidus +52 -0
  17. data/lib/solidus_dev_support.rb +15 -0
  18. data/lib/solidus_dev_support/extension.rb +50 -0
  19. data/lib/solidus_dev_support/rake_tasks.rb +61 -0
  20. data/lib/solidus_dev_support/rspec/coverage.rb +22 -0
  21. data/lib/solidus_dev_support/rspec/feature_helper.rb +39 -0
  22. data/lib/solidus_dev_support/rspec/rails_helper.rb +60 -0
  23. data/lib/solidus_dev_support/rspec/spec_helper.rb +25 -0
  24. data/lib/solidus_dev_support/rubocop.rb +16 -0
  25. data/lib/solidus_dev_support/rubocop/config.yml +201 -0
  26. data/lib/solidus_dev_support/templates/extension/.circleci/config.yml +35 -0
  27. data/lib/solidus_dev_support/templates/extension/.github/stale.yml +17 -0
  28. data/lib/solidus_dev_support/templates/extension/CONTRIBUTING.md +57 -0
  29. data/lib/solidus_dev_support/templates/extension/Gemfile +25 -0
  30. data/lib/solidus_dev_support/templates/extension/LICENSE +26 -0
  31. data/lib/solidus_dev_support/templates/extension/README.md +48 -0
  32. data/lib/solidus_dev_support/templates/extension/Rakefile +32 -0
  33. data/lib/solidus_dev_support/templates/extension/app/assets/javascripts/spree/backend/%file_name%.js +2 -0
  34. data/lib/solidus_dev_support/templates/extension/app/assets/javascripts/spree/frontend/%file_name%.js +2 -0
  35. data/lib/solidus_dev_support/templates/extension/app/assets/stylesheets/spree/backend/%file_name%.css +4 -0
  36. data/lib/solidus_dev_support/templates/extension/app/assets/stylesheets/spree/frontend/%file_name%.css +4 -0
  37. data/lib/solidus_dev_support/templates/extension/bin/rails.tt +7 -0
  38. data/lib/solidus_dev_support/templates/extension/config/locales/en.yml +5 -0
  39. data/lib/solidus_dev_support/templates/extension/config/routes.rb +5 -0
  40. data/lib/solidus_dev_support/templates/extension/extension.gemspec.erb +23 -0
  41. data/lib/solidus_dev_support/templates/extension/gem_release.yml.tt +5 -0
  42. data/lib/solidus_dev_support/templates/extension/gitignore +15 -0
  43. data/lib/solidus_dev_support/templates/extension/lib/%file_name%.rb.tt +4 -0
  44. data/lib/solidus_dev_support/templates/extension/lib/%file_name%/engine.rb.tt +22 -0
  45. data/lib/solidus_dev_support/templates/extension/lib/%file_name%/factories.rb.tt +4 -0
  46. data/lib/solidus_dev_support/templates/extension/lib/%file_name%/version.rb.tt +5 -0
  47. data/lib/solidus_dev_support/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt +32 -0
  48. data/lib/solidus_dev_support/templates/extension/rspec +1 -0
  49. data/lib/solidus_dev_support/templates/extension/rubocop.yml +15 -0
  50. data/lib/solidus_dev_support/templates/extension/spec/spec_helper.rb.tt +24 -0
  51. data/lib/solidus_dev_support/testing_support/preferences.rb +45 -0
  52. data/lib/solidus_dev_support/version.rb +5 -0
  53. data/solidus_dev_support.gemspec +50 -0
  54. metadata +384 -0
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidusDevSupport
4
+ module TestingSupport
5
+ module Preferences
6
+ # This wrapper method allows to stub spree preferences using
7
+ # the new standard way of solidus core but also works with
8
+ # old versions that does not have the stub_spree_preferences
9
+ # method yet. This way we can start using this method in our
10
+ # extensions safely.
11
+ #
12
+ # To have this available, it is needed to require in the
13
+ # spec/spec_helper.rb of the extension both:
14
+ #
15
+ # require 'spree/testing_support/preferences'
16
+ # require 'solidus_dev_support/testing_support/preferences'
17
+ #
18
+ # @example Set a preference on Spree::Config
19
+ # stub_spree_preferences(allow_guest_checkout: false)
20
+ #
21
+ # @example Set a preference on Spree::Api::Config
22
+ # stub_spree_preferences(Spree::Api::Config, requires_authentication: false)
23
+ #
24
+ # @example Set a preference on a custom Spree::CustomExtension::Config
25
+ # stub_spree_preferences(Spree::CustomExtension::Config, custom_pref: true)
26
+ #
27
+ # @param prefs_or_conf_class [Class, Hash] the class we want to stub
28
+ # preferences for or the preferences hash (see prefs param). If this
29
+ # param is an Hash, preferences will be stubbed on Spree::Config.
30
+ # @param prefs [Hash, nil] names and values to be stubbed
31
+ def stub_spree_preferences(prefs_or_conf_class, prefs = nil)
32
+ super && return if SolidusDevSupport.reset_spree_preferences_deprecated?
33
+
34
+ if prefs_or_conf_class.is_a?(Hash)
35
+ preference_store_class = Spree::Config
36
+ preferences = prefs_or_conf_class
37
+ else
38
+ preference_store_class = prefs_or_conf_class
39
+ preferences = prefs
40
+ end
41
+ preference_store_class.set(preferences)
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidusDevSupport
4
+ VERSION = "0.2.0"
5
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'solidus_dev_support/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'solidus_dev_support'
9
+ spec.version = SolidusDevSupport::VERSION
10
+ spec.authors = ['Alessandro Desantis']
11
+ spec.email = ['alessandrodesantis@nebulab.it']
12
+
13
+ spec.summary = 'Development tools for Solidus extensions.'
14
+ spec.homepage = 'https://github.com/solidusio/solidus_dev_support'
15
+ spec.license = 'MIT'
16
+
17
+ spec.metadata['homepage_uri'] = spec.homepage
18
+ spec.metadata['source_code_uri'] = 'https://github.com/solidusio/solidus_dev_support'
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ end
25
+ spec.bindir = 'exe'
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ['lib']
28
+
29
+ spec.add_dependency 'apparition', '~> 0.4'
30
+ spec.add_dependency 'capybara', '~> 3.29'
31
+ spec.add_dependency 'capybara-screenshot', '~> 1.0'
32
+ spec.add_dependency 'codecov', '~> 0.1.16'
33
+ spec.add_dependency 'database_cleaner', '~> 1.7'
34
+ spec.add_dependency 'factory_bot_rails', '~> 5.1'
35
+ spec.add_dependency 'ffaker', '~> 2.13'
36
+ spec.add_dependency 'gem-release', '~> 2.1'
37
+ spec.add_dependency 'github_changelog_generator', '~> 1.15'
38
+ spec.add_dependency 'puma', '~> 4.3'
39
+ spec.add_dependency 'rspec-rails', '~> 4.0.0.beta3'
40
+ spec.add_dependency 'rspec_junit_formatter'
41
+ spec.add_dependency 'rubocop', '~> 0.76.0'
42
+ spec.add_dependency 'rubocop-performance', '~> 1.5'
43
+ spec.add_dependency 'rubocop-rails', '~> 2.3'
44
+ spec.add_dependency 'rubocop-rspec', '~> 1.36'
45
+ spec.add_dependency 'solidus_core', ['>= 2.0', '< 3']
46
+ spec.add_dependency 'solidus_support', '~> 0.3.3'
47
+
48
+ spec.add_development_dependency 'bundler'
49
+ spec.add_development_dependency 'rake'
50
+ end
metadata ADDED
@@ -0,0 +1,384 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: solidus_dev_support
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Alessandro Desantis
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-12-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: apparition
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: capybara
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.29'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.29'
41
+ - !ruby/object:Gem::Dependency
42
+ name: capybara-screenshot
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: codecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.1.16
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.1.16
69
+ - !ruby/object:Gem::Dependency
70
+ name: database_cleaner
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.7'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.7'
83
+ - !ruby/object:Gem::Dependency
84
+ name: factory_bot_rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '5.1'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '5.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: ffaker
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.13'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.13'
111
+ - !ruby/object:Gem::Dependency
112
+ name: gem-release
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.1'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.1'
125
+ - !ruby/object:Gem::Dependency
126
+ name: github_changelog_generator
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.15'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.15'
139
+ - !ruby/object:Gem::Dependency
140
+ name: puma
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '4.3'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '4.3'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rspec-rails
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 4.0.0.beta3
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 4.0.0.beta3
167
+ - !ruby/object:Gem::Dependency
168
+ name: rspec_junit_formatter
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 0.76.0
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 0.76.0
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop-performance
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '1.5'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '1.5'
209
+ - !ruby/object:Gem::Dependency
210
+ name: rubocop-rails
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '2.3'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '2.3'
223
+ - !ruby/object:Gem::Dependency
224
+ name: rubocop-rspec
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '1.36'
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '1.36'
237
+ - !ruby/object:Gem::Dependency
238
+ name: solidus_core
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ">="
242
+ - !ruby/object:Gem::Version
243
+ version: '2.0'
244
+ - - "<"
245
+ - !ruby/object:Gem::Version
246
+ version: '3'
247
+ type: :runtime
248
+ prerelease: false
249
+ version_requirements: !ruby/object:Gem::Requirement
250
+ requirements:
251
+ - - ">="
252
+ - !ruby/object:Gem::Version
253
+ version: '2.0'
254
+ - - "<"
255
+ - !ruby/object:Gem::Version
256
+ version: '3'
257
+ - !ruby/object:Gem::Dependency
258
+ name: solidus_support
259
+ requirement: !ruby/object:Gem::Requirement
260
+ requirements:
261
+ - - "~>"
262
+ - !ruby/object:Gem::Version
263
+ version: 0.3.3
264
+ type: :runtime
265
+ prerelease: false
266
+ version_requirements: !ruby/object:Gem::Requirement
267
+ requirements:
268
+ - - "~>"
269
+ - !ruby/object:Gem::Version
270
+ version: 0.3.3
271
+ - !ruby/object:Gem::Dependency
272
+ name: bundler
273
+ requirement: !ruby/object:Gem::Requirement
274
+ requirements:
275
+ - - ">="
276
+ - !ruby/object:Gem::Version
277
+ version: '0'
278
+ type: :development
279
+ prerelease: false
280
+ version_requirements: !ruby/object:Gem::Requirement
281
+ requirements:
282
+ - - ">="
283
+ - !ruby/object:Gem::Version
284
+ version: '0'
285
+ - !ruby/object:Gem::Dependency
286
+ name: rake
287
+ requirement: !ruby/object:Gem::Requirement
288
+ requirements:
289
+ - - ">="
290
+ - !ruby/object:Gem::Version
291
+ version: '0'
292
+ type: :development
293
+ prerelease: false
294
+ version_requirements: !ruby/object:Gem::Requirement
295
+ requirements:
296
+ - - ">="
297
+ - !ruby/object:Gem::Version
298
+ version: '0'
299
+ description:
300
+ email:
301
+ - alessandrodesantis@nebulab.it
302
+ executables:
303
+ - solidus
304
+ extensions: []
305
+ extra_rdoc_files: []
306
+ files:
307
+ - ".circleci/config.yml"
308
+ - ".github/PULL_REQUEST_TEMPLATE.md"
309
+ - ".github/stale.yml"
310
+ - ".gitignore"
311
+ - ".rspec"
312
+ - ".rubocop-https---relaxed-ruby-style-rubocop-yml"
313
+ - ".rubocop.yml"
314
+ - CHANGELOG.md
315
+ - Gemfile
316
+ - LICENSE.txt
317
+ - README.md
318
+ - Rakefile
319
+ - bin/console
320
+ - bin/setup
321
+ - exe/solidus
322
+ - lib/solidus_dev_support.rb
323
+ - lib/solidus_dev_support/extension.rb
324
+ - lib/solidus_dev_support/rake_tasks.rb
325
+ - lib/solidus_dev_support/rspec/coverage.rb
326
+ - lib/solidus_dev_support/rspec/feature_helper.rb
327
+ - lib/solidus_dev_support/rspec/rails_helper.rb
328
+ - lib/solidus_dev_support/rspec/spec_helper.rb
329
+ - lib/solidus_dev_support/rubocop.rb
330
+ - lib/solidus_dev_support/rubocop/config.yml
331
+ - lib/solidus_dev_support/templates/extension/.circleci/config.yml
332
+ - lib/solidus_dev_support/templates/extension/.github/stale.yml
333
+ - lib/solidus_dev_support/templates/extension/CONTRIBUTING.md
334
+ - lib/solidus_dev_support/templates/extension/Gemfile
335
+ - lib/solidus_dev_support/templates/extension/LICENSE
336
+ - lib/solidus_dev_support/templates/extension/README.md
337
+ - lib/solidus_dev_support/templates/extension/Rakefile
338
+ - lib/solidus_dev_support/templates/extension/app/assets/javascripts/spree/backend/%file_name%.js
339
+ - lib/solidus_dev_support/templates/extension/app/assets/javascripts/spree/frontend/%file_name%.js
340
+ - lib/solidus_dev_support/templates/extension/app/assets/stylesheets/spree/backend/%file_name%.css
341
+ - lib/solidus_dev_support/templates/extension/app/assets/stylesheets/spree/frontend/%file_name%.css
342
+ - lib/solidus_dev_support/templates/extension/bin/rails.tt
343
+ - lib/solidus_dev_support/templates/extension/config/locales/en.yml
344
+ - lib/solidus_dev_support/templates/extension/config/routes.rb
345
+ - lib/solidus_dev_support/templates/extension/extension.gemspec.erb
346
+ - lib/solidus_dev_support/templates/extension/gem_release.yml.tt
347
+ - lib/solidus_dev_support/templates/extension/gitignore
348
+ - lib/solidus_dev_support/templates/extension/lib/%file_name%.rb.tt
349
+ - lib/solidus_dev_support/templates/extension/lib/%file_name%/engine.rb.tt
350
+ - lib/solidus_dev_support/templates/extension/lib/%file_name%/factories.rb.tt
351
+ - lib/solidus_dev_support/templates/extension/lib/%file_name%/version.rb.tt
352
+ - lib/solidus_dev_support/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
353
+ - lib/solidus_dev_support/templates/extension/rspec
354
+ - lib/solidus_dev_support/templates/extension/rubocop.yml
355
+ - lib/solidus_dev_support/templates/extension/spec/spec_helper.rb.tt
356
+ - lib/solidus_dev_support/testing_support/preferences.rb
357
+ - lib/solidus_dev_support/version.rb
358
+ - solidus_dev_support.gemspec
359
+ homepage: https://github.com/solidusio/solidus_dev_support
360
+ licenses:
361
+ - MIT
362
+ metadata:
363
+ homepage_uri: https://github.com/solidusio/solidus_dev_support
364
+ source_code_uri: https://github.com/solidusio/solidus_dev_support
365
+ post_install_message:
366
+ rdoc_options: []
367
+ require_paths:
368
+ - lib
369
+ required_ruby_version: !ruby/object:Gem::Requirement
370
+ requirements:
371
+ - - ">="
372
+ - !ruby/object:Gem::Version
373
+ version: '0'
374
+ required_rubygems_version: !ruby/object:Gem::Requirement
375
+ requirements:
376
+ - - ">="
377
+ - !ruby/object:Gem::Version
378
+ version: '0'
379
+ requirements: []
380
+ rubygems_version: 3.0.6
381
+ signing_key:
382
+ specification_version: 4
383
+ summary: Development tools for Solidus extensions.
384
+ test_files: []