shopify-money 3.0.1 → 3.0.3

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: de1e039c5ccec77ffce929e26f1e4dde3cd5926efa1b40b25c936ee3c2b6b371
4
- data.tar.gz: e07dd5347acf25da2db513995e627717e05045425dd5a51ba4bb308c4bc2fe63
3
+ metadata.gz: 1395b621839646adc7561da3b65bdb3ca4fcd13a972be703acec64a9a08daa47
4
+ data.tar.gz: 6dfc464f1c15c8eb06734cc988c7d4843d88670fca3d8889307c0b0caffa309e
5
5
  SHA512:
6
- metadata.gz: 9bf5be045a44b3028cedd31874ebfed0de5112535b5fab3237eb8ebc1a25565eb0ba15b1a65de0fa0d030d8b7ff684b932913a1e696d3b581d057ef66026d390
7
- data.tar.gz: 1b4bed314edab5fa7c29393e232f148923eda6248b9a9a3477b7c070bf724f61ff2b03bbf4d6bd2caf9f70116fbb9fa5c3eb7fd56ea143dd0c51e111f13ccddd
6
+ metadata.gz: 6fe1e1d79cd6f9f64b1c3beb0899b44eda823af1360f774caec6c10df22baedf63fa60ee46a1bb551940305ab9a69f737304074c5aa8bd2ab7f67fe72275b657
7
+ data.tar.gz: a42890315f7a76a5bcdd24207262619704876e0c9dba2526919f05fd16a1b1f1f53048df2871474cb0c7fae1cc6b542b453c7bbff61c78d428fa4af2bc3b6de4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-money (3.0.1)
4
+ shopify-money (3.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -104,10 +104,11 @@ GEM
104
104
  irb (1.14.1)
105
105
  rdoc (>= 4.0.0)
106
106
  reline (>= 0.4.2)
107
- json (2.7.2)
108
- language_server-protocol (3.17.0.3)
107
+ json (2.10.2)
108
+ language_server-protocol (3.17.0.4)
109
+ lint_roller (1.1.0)
109
110
  logger (1.6.1)
110
- loofah (2.22.0)
111
+ loofah (2.24.0)
111
112
  crass (~> 1.0.2)
112
113
  nokogiri (>= 1.12.0)
113
114
  mail (2.8.1)
@@ -118,6 +119,7 @@ GEM
118
119
  marcel (1.0.4)
119
120
  method_source (1.1.0)
120
121
  mini_mime (1.1.5)
122
+ mini_portile2 (2.8.8)
121
123
  minitest (5.25.1)
122
124
  net-imap (0.5.0)
123
125
  date
@@ -129,20 +131,21 @@ GEM
129
131
  net-smtp (0.5.0)
130
132
  net-protocol
131
133
  nio4r (2.7.3)
132
- nokogiri (1.16.7-aarch64-linux)
134
+ nokogiri (1.18.3)
135
+ mini_portile2 (~> 2.8.2)
133
136
  racc (~> 1.4)
134
- nokogiri (1.16.7-arm-linux)
137
+ nokogiri (1.18.3-aarch64-linux-gnu)
135
138
  racc (~> 1.4)
136
- nokogiri (1.16.7-arm64-darwin)
139
+ nokogiri (1.18.3-arm-linux-gnu)
137
140
  racc (~> 1.4)
138
- nokogiri (1.16.7-x86-linux)
141
+ nokogiri (1.18.3-arm64-darwin)
139
142
  racc (~> 1.4)
140
- nokogiri (1.16.7-x86_64-darwin)
143
+ nokogiri (1.18.3-x86_64-darwin)
141
144
  racc (~> 1.4)
142
- nokogiri (1.16.7-x86_64-linux)
145
+ nokogiri (1.18.3-x86_64-linux-gnu)
143
146
  racc (~> 1.4)
144
147
  parallel (1.26.3)
145
- parser (3.3.5.0)
148
+ parser (3.3.7.1)
146
149
  ast (~> 2.4.1)
147
150
  racc
148
151
  pry (0.14.2)
@@ -180,9 +183,9 @@ GEM
180
183
  activesupport (>= 5.0.0)
181
184
  minitest
182
185
  nokogiri (>= 1.6)
183
- rails-html-sanitizer (1.6.0)
186
+ rails-html-sanitizer (1.6.1)
184
187
  loofah (~> 2.21)
185
- nokogiri (~> 1.14)
188
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
186
189
  railties (7.2.1.1)
187
190
  actionpack (= 7.2.1.1)
188
191
  activesupport (= 7.2.1.1)
@@ -195,7 +198,7 @@ GEM
195
198
  rake (13.2.1)
196
199
  rdoc (6.7.0)
197
200
  psych (>= 4.0.0)
198
- regexp_parser (2.9.2)
201
+ regexp_parser (2.10.0)
199
202
  reline (0.5.10)
200
203
  io-console (~> 0.5)
201
204
  rspec (3.13.0)
@@ -211,17 +214,18 @@ GEM
211
214
  diff-lcs (>= 1.2.0, < 2.0)
212
215
  rspec-support (~> 3.13.0)
213
216
  rspec-support (3.13.1)
214
- rubocop (1.67.0)
217
+ rubocop (1.74.0)
215
218
  json (~> 2.3)
216
- language_server-protocol (>= 3.17.0)
219
+ language_server-protocol (~> 3.17.0.2)
220
+ lint_roller (~> 1.1.0)
217
221
  parallel (~> 1.10)
218
222
  parser (>= 3.3.0.2)
219
223
  rainbow (>= 2.2.2, < 4.0)
220
- regexp_parser (>= 2.4, < 3.0)
221
- rubocop-ast (>= 1.32.2, < 2.0)
224
+ regexp_parser (>= 2.9.3, < 3.0)
225
+ rubocop-ast (>= 1.38.0, < 2.0)
222
226
  ruby-progressbar (~> 1.7)
223
- unicode-display_width (>= 2.4.0, < 3.0)
224
- rubocop-ast (1.32.3)
227
+ unicode-display_width (>= 2.4.0, < 4.0)
228
+ rubocop-ast (1.39.0)
225
229
  parser (>= 3.3.1.0)
226
230
  rubocop-performance (1.22.1)
227
231
  rubocop (>= 1.48.1, < 2.0)
@@ -247,7 +251,9 @@ GEM
247
251
  timeout (0.4.1)
248
252
  tzinfo (2.0.6)
249
253
  concurrent-ruby (~> 1.0)
250
- unicode-display_width (2.6.0)
254
+ unicode-display_width (3.1.4)
255
+ unicode-emoji (~> 4.0, >= 4.0.4)
256
+ unicode-emoji (4.0.4)
251
257
  useragent (0.16.10)
252
258
  webrick (1.8.2)
253
259
  websocket-driver (0.7.6)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Money.class_eval do
4
4
  ACTIVE_SUPPORT_DEFINED = defined?(ActiveSupport)
5
- DEPRECATION_STACKTRACE_LENGTH = 5
5
+ DEPRECATION_STACKTRACE_LENGTH = 20
6
6
 
7
7
  def self.active_support_deprecator
8
8
  @active_support_deprecator ||= begin
data/lib/money/money.rb CHANGED
@@ -42,7 +42,7 @@ class Money
42
42
  def_delegators :config, :default_currency, :default_currency=, :without_legacy_deprecations
43
43
 
44
44
  def config
45
- Thread.current[:shopify_money__config] ||= Config.new
45
+ Thread.current[:shopify_money__config] ||= @config.dup
46
46
  end
47
47
 
48
48
  def config=(config)
@@ -50,7 +50,8 @@ class Money
50
50
  end
51
51
 
52
52
  def configure
53
- yield(config) if block_given?
53
+ @config ||= Config.new
54
+ yield(@config) if block_given?
54
55
  end
55
56
 
56
57
  def new(value = 0, currency = nil)
data/lib/money/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Money
4
- VERSION = "3.0.1"
4
+ VERSION = "3.0.3"
5
5
  end
data/spec/config_spec.rb CHANGED
@@ -4,14 +4,18 @@ require 'spec_helper'
4
4
  RSpec.describe "Money::Config" do
5
5
  describe 'thread safety' do
6
6
  it 'does not share the same config across threads' do
7
- configure(legacy_deprecations: true, default_currency: 'USD') do
8
- expect(Money.config.legacy_deprecations).to eq(true)
9
- expect(Money.default_currency).to eq('USD')
7
+ configure(legacy_deprecations: false, default_currency: 'USD') do
8
+ expect(Money.config.legacy_deprecations).to eq(false)
9
+ expect(Money.config.default_currency).to eq('USD')
10
10
  thread = Thread.new do
11
- expect(Money.config.legacy_deprecations).to eq(false)
12
- expect(Money.default_currency).to eq(nil)
11
+ Money.config.legacy_deprecations!
12
+ Money.default_currency = "EUR"
13
+ expect(Money.config.legacy_deprecations).to eq(true)
14
+ expect(Money.config.default_currency).to eq("EUR")
13
15
  end
14
16
  thread.join
17
+ expect(Money.config.legacy_deprecations).to eq(false)
18
+ expect(Money.config.default_currency).to eq('USD')
15
19
  end
16
20
  end
17
21
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify Inc
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-19 00:00:00.000000000 Z
10
+ date: 2025-03-24 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bundler
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  - !ruby/object:Gem::Version
189
189
  version: '0'
190
190
  requirements: []
191
- rubygems_version: 3.6.3
191
+ rubygems_version: 3.6.6
192
192
  specification_version: 4
193
193
  summary: Shopify's money gem
194
194
  test_files: []