solidus_core 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_core might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6d8a64c0ba51b637a6a5eb82952d5920f388413f74d271920c41b6c34b00b5f
4
- data.tar.gz: a92bbdc37bd0a9f9a53fe943542ba0f4890af67290faf937de4a57583cdb1ffa
3
+ metadata.gz: 84e6a49d44adf0951d9e774b0e212f39841ca0183827e5ec902d5dfb13f27cf2
4
+ data.tar.gz: 1d7e7b23b450a781782ac2259ccd50aa54b455c7b07e90070a2c39ff3320b640
5
5
  SHA512:
6
- metadata.gz: 0dd269d1a10a861a6d76cba306cf3b42b758773d4fe4e3265986e0abfe318e40ba2468d6431ec89d472b72591a23e19684a20afa37bb48f0be71371e79736e0f
7
- data.tar.gz: c524310230c534ebc135368fbf5d1b75def4f3b3672f8b4818b85d6e40d2fd04f1bfb03e37d0218f37d5b5bb7167499c2deff8bbd2593a8571f9b1de211d665c
6
+ metadata.gz: f5caeff8f63a04cc9df497e06e3f782a0f6ff994464b98e5d9f1db58e3cf1149b1a02cf2dd707c4bb5291aad76ff91682df6797fcb56fd87522cda874bbcd0a2
7
+ data.tar.gz: 6150acbad591a8bc78d2283dd253deb1c5f47470194117a016d72e32cf633a5e9e56dbf7343d87fd0ffdef8cef4f7ea588ef45481acb918010fe4c2e647bee96
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spree
4
- VERSION = "3.1.0"
4
+ VERSION = "3.1.1"
5
5
 
6
6
  def self.solidus_version
7
7
  VERSION
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'spree/deprecation'
3
4
  require 'spree/encryptor'
4
5
 
5
6
  module Spree::Preferences
@@ -26,8 +27,38 @@ module Spree::Preferences
26
27
  options[:default] = preference_encryptor.encrypt(options[:default])
27
28
  end
28
29
 
29
- default = options[:default]
30
- default = proc { options[:default] } unless default.is_a?(Proc)
30
+ default = begin
31
+ given = options[:default]
32
+ if ancestors.include?(Spree::Preferences::Configuration) &&
33
+ given.is_a?(Proc) &&
34
+ given.lambda? &&
35
+ given.arity.zero?
36
+ Spree::Deprecation.warn <<~MSG
37
+ The arity of a proc given as the default for a preference
38
+ has changed from 0 to 1 on Solidus 3.1. The Solidus
39
+ version for the loaded preference defaults is given as the
40
+ proc's argument from this point on.
41
+
42
+ If you don't need to return a different default value
43
+ depending on the loaded Solidus version, you can change
44
+ the proc so that it doesn't have lambda semantics (lambdas
45
+ raise when extra arguments are supplied, while raw procs
46
+ don't). E.g.:
47
+
48
+ preference :foo, :string, default: proc { true }
49
+
50
+ If you want to branch on the provided Solidus version, you can do like the following:
51
+
52
+ preference :foo, :string, default: by_version(true, "3.2.0" => false)
53
+
54
+ MSG
55
+ ->(_default_context) { given.call }
56
+ elsif given.is_a?(Proc)
57
+ given
58
+ else
59
+ proc { given }
60
+ end
61
+ end
31
62
 
32
63
  # The defined preferences on a class are all those defined directly on
33
64
  # that class as well as those defined on ancestors.
data/solidus_core.gemspec CHANGED
@@ -55,7 +55,12 @@ $ bin/rails g solidus:install
55
55
  If you are updating Solidus from an older version, please run
56
56
  the following commands to complete the update:
57
57
 
58
- $ bin/rails solidus:upgrade
58
+ $ bin/rails g solidus:update
59
+
60
+ Please, don't forget to look at the CHANGELOG to see what has changed and
61
+ whether you need to perform other tasks.
62
+
63
+ https://github.com/solidusio/solidus/blob/master/CHANGELOG.md
59
64
 
60
65
  Please report any issues at:
61
66
  - https://github.com/solidusio/solidus/issues
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-10 00:00:00.000000000 Z
11
+ date: 2021-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -928,7 +928,12 @@ post_install_message: |
928
928
  If you are updating Solidus from an older version, please run
929
929
  the following commands to complete the update:
930
930
 
931
- $ bin/rails solidus:upgrade
931
+ $ bin/rails g solidus:update
932
+
933
+ Please, don't forget to look at the CHANGELOG to see what has changed and
934
+ whether you need to perform other tasks.
935
+
936
+ https://github.com/solidusio/solidus/blob/master/CHANGELOG.md
932
937
 
933
938
  Please report any issues at:
934
939
  - https://github.com/solidusio/solidus/issues