solidus_support 0.7.0 → 0.8.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '07148224b06a9d4a742b7fdf8d9d5a61a7637122bab0b18df1c32ccf69401e78'
4
- data.tar.gz: c315077b626b83202aadf873cca2020f87a14983b5acd2b50d19facf608d85ac
3
+ metadata.gz: 3d0b61a92f9ea8174330391a7bad3543dc0725f68e9fd380011391e580abab75
4
+ data.tar.gz: 269a38d161f392811ed2ec1c2a523b67a92557b7a9828c2c2639a2d504df06a6
5
5
  SHA512:
6
- metadata.gz: f5d3b639b91329457f5178afccb7ec30af0b523ec57bf3ba94b310bc8992c343b5841144797ac12a0912ae41b3faae7f909eca0ae6cd7484bb754c21af1ab83b
7
- data.tar.gz: a70259d8ea10233f470896a75973b2f063ff259a2c2331191f1dadc21086e9339d193352d5c08a9895cb4802d4cae4a54951dc12fd252fc77ddec7f9c4921300
6
+ metadata.gz: 34ab8b557078b085cd966e3e45652ba7f20e4b26588f74a66f94da5f0dc7cd1824f68672d354656d346baa97bc1f8d3e37b469ab0871d5a247af1a7368b23bb2
7
+ data.tar.gz: 4401a91bdecea435d21f175ea4c1dd77b3f68006ed6221338435e6e1f8a27de6b0533dfdb88ec3ab6401554125d0de187fd38ff7a77a99fc59350292734eab4f
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.7.0](https://github.com/solidusio/solidus_support/tree/v0.7.0) (2020-10-28)
4
+
5
+ [Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.6.0...v0.7.0)
6
+
7
+ **Closed issues:**
8
+
9
+ - Could we get a new release? [\#49](https://github.com/solidusio/solidus_support/issues/49)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Use `Spree::Event. activate\_all\_subscribers` when available [\#53](https://github.com/solidusio/solidus_support/pull/53) ([spaghetticode](https://github.com/spaghetticode))
14
+ - Support Rails 5.1.x [\#51](https://github.com/solidusio/solidus_support/pull/51) ([brchristian](https://github.com/brchristian))
15
+ - Remove redundant `solidus\_core` dev dependency [\#50](https://github.com/solidusio/solidus_support/pull/50) ([brchristian](https://github.com/brchristian))
16
+
3
17
  ## [v0.6.0](https://github.com/solidusio/solidus_support/tree/v0.6.0) (2020-07-24)
4
18
 
5
19
  [Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.5.1...v0.6.0)
@@ -105,7 +119,6 @@
105
119
 
106
120
  - Rename FactoryBot [\#6](https://github.com/solidusio/solidus_support/pull/6) ([tvdeyen](https://github.com/tvdeyen))
107
121
  - Remove unused files [\#5](https://github.com/solidusio/solidus_support/pull/5) ([tvdeyen](https://github.com/tvdeyen))
108
- - Add a basic spec\_helper for extensions to include [\#2](https://github.com/solidusio/solidus_support/pull/2) ([jhawthorn](https://github.com/jhawthorn))
109
122
 
110
123
  ## [v0.1.5](https://github.com/solidusio/solidus_support/tree/v0.1.5) (2017-07-27)
111
124
 
@@ -119,6 +132,10 @@
119
132
 
120
133
  [Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.1.2...v0.1.3)
121
134
 
135
+ **Merged pull requests:**
136
+
137
+ - Add a basic spec\_helper for extensions to include [\#2](https://github.com/solidusio/solidus_support/pull/2) ([jhawthorn](https://github.com/jhawthorn))
138
+
122
139
  ## [v0.1.2](https://github.com/solidusio/solidus_support/tree/v0.1.2) (2017-07-24)
123
140
 
124
141
  [Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.1.1...v0.1.2)
data/Gemfile CHANGED
@@ -16,3 +16,15 @@ else
16
16
  end
17
17
 
18
18
  gemspec
19
+
20
+ # There is an issue with Sprockets 4 not accepting a custom path for
21
+ # the assets manifest, which doesn't play well with in-memory dummy
22
+ # apps such as the one we use in this gem.
23
+
24
+ # A fix was provided for sprockets-rails[1] but it was not accepted
25
+ # yet.
26
+
27
+ # [1]: rails/sprockets-rails#446
28
+ #
29
+ # Please do not remove this line until we have a solution.
30
+ gem 'sprockets', '~> 3'
@@ -3,6 +3,7 @@
3
3
  # frozen_string_literal: true
4
4
 
5
5
  require "bundler/setup"
6
+ require "rails/all"
6
7
  require "solidus_support"
7
8
 
8
9
  # You can add fixtures and/or initialization code here to make experimenting
@@ -21,6 +21,16 @@ module SolidusSupport
21
21
  first_version_without_reset.satisfied_by?(Spree.solidus_gem_version)
22
22
  end
23
23
 
24
+ def combined_first_and_last_name_in_address?
25
+ versions_before_preference = Gem::Requirement.new('< 2.10')
26
+ versions_after_preference = Gem::Requirement.new('>= 3.0.0.alpha')
27
+
28
+ return false if versions_before_preference.satisfied_by?(Spree.solidus_gem_version)
29
+ return true if versions_after_preference.satisfied_by?(Spree.solidus_gem_version)
30
+
31
+ Spree::Config.use_combined_first_and_last_name_in_address
32
+ end
33
+
24
34
  def new_gateway_code?
25
35
  first_version_with_new_gateway_code = Gem::Requirement.new('>= 2.3')
26
36
  first_version_with_new_gateway_code.satisfied_by?(Spree.solidus_gem_version)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusSupport
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.0'
5
5
  end
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  s.require_paths = ["lib"]
23
23
 
24
+ s.add_development_dependency 'rails'
24
25
  s.add_development_dependency 'bundler'
25
26
  s.add_development_dependency 'rake'
26
27
  s.add_development_dependency 'rspec-rails'
@@ -42,4 +42,37 @@ RSpec.describe SolidusSupport do
42
42
  end
43
43
  # rubocop:enable RSpec/NestedGroups
44
44
  end
45
+
46
+ describe '.combined_first_and_last_name_in_address?' do
47
+ subject { described_class.combined_first_and_last_name_in_address? }
48
+
49
+ before do
50
+ allow(Spree).to receive(:solidus_gem_version) do
51
+ Gem::Version.new(solidus_version)
52
+ end
53
+ end
54
+
55
+ context 'when Solidus did not have the code to combine addresses fields' do
56
+ let(:solidus_version) { '2.9.3' }
57
+
58
+ it { is_expected.to be_falsey }
59
+ end
60
+
61
+ context 'when Solidus has preference to choose if combine addresses fields' do
62
+ let(:solidus_version) { '2.10.3' }
63
+ before do
64
+ allow(Spree::Config)
65
+ .to receive(:use_combined_first_and_last_name_in_address)
66
+ .and_return(true)
67
+ end
68
+
69
+ it { is_expected.to be_truthy }
70
+ end
71
+
72
+ context 'when Solidus only has code to combine addresses fields' do
73
+ let(:solidus_version) { '3.0.0' }
74
+
75
+ it { is_expected.to be_truthy }
76
+ end
77
+ end
45
78
  end
@@ -14,7 +14,6 @@ module DummyApp
14
14
  class Application < ::Rails::Application
15
15
  config.eager_load = false
16
16
  config.paths['config/database'] = File.expand_path('dummy_app/database.yml', __dir__)
17
- config.active_record.sqlite3.represent_boolean_as_integer = true unless Gem::Version.new(Rails.version) < Gem::Version.new('5.2')
18
17
  end
19
18
  end
20
19
 
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-28 00:00:00.000000000 Z
11
+ date: 2021-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -142,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
156
  - !ruby/object:Gem::Version
143
157
  version: '0'
144
158
  requirements: []
145
- rubygems_version: 3.0.3
159
+ rubygems_version: 3.1.4
146
160
  signing_key:
147
161
  specification_version: 4
148
162
  summary: Common runtime helpers for Solidus extensions.