money 6.13.5 → 6.13.6

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: d517e06943977328b7ad20b73554269088b01b947c280cc454f87ef88dfb8e2d
4
- data.tar.gz: 2c7c5ba4c19a5ff2413273cb64443b5628468b083f260f8cdf49c133e3b7319e
3
+ metadata.gz: f41d31f75d5bff854667ff0d38d23b7ffa7e40f4cc4be7732aed48303bf3c3e4
4
+ data.tar.gz: 9291b358b1ed9cf0fd5add31910735fcc4ce32d320068e8b3607c2e95e7dd108
5
5
  SHA512:
6
- metadata.gz: f1cbd0d2e7f790a00528531b3f325bffb4ee8aef98917cc1c17232684eeb5ffb66ce56ebd0618146302468e1259cb284d3a96e576c4592fc67db41cddfb14a64
7
- data.tar.gz: 1d3c22cde9570f93dba5f86952b35a952b0dbfc95262c051e36f0829f8ac06669181cf0b10524d0df44123ae2095c60e8301af999f89a1119ac6d252fddcb6dc
6
+ metadata.gz: 4f3132b6ee0c2f4a4a49128a60316598da0e33f2fcfe9d123feac5f89f2498ffe2a166876ddfb9c628431e727fc2b88d40dc8f6660621a6ba269a36745f4ee92
7
+ data.tar.gz: a0ae9e326bea5273d4cb05849cf0efa30c7b210914bdca9a37ed56e5f4aece8d04f22715d326a751e5a9631d671e9bc4e6c04b1726b9b83d6c75feba9d0e094e
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.13.6
4
+ - Fix a regression introduced in 6.13.5 that broken RatesStore::Memory subclasses
5
+
3
6
  ## 6.13.5
4
7
  - Raise warning on using Money.default_currency
5
8
  - Raise warning on using default Money.rounding_mode
@@ -39,8 +39,8 @@ class Money
39
39
  # store.add_rate("USD", "CAD", 1.24515)
40
40
  # store.add_rate("CAD", "USD", 0.803115)
41
41
  def add_rate(currency_iso_from, currency_iso_to, rate)
42
- @guard.synchronize do
43
- @rates[rate_key_for(currency_iso_from, currency_iso_to)] = rate
42
+ guard.synchronize do
43
+ rates[rate_key_for(currency_iso_from, currency_iso_to)] = rate
44
44
  end
45
45
  end
46
46
 
@@ -58,20 +58,20 @@ class Money
58
58
  #
59
59
  # store.get_rate("USD", "CAD") #=> 1.24515
60
60
  def get_rate(currency_iso_from, currency_iso_to)
61
- @guard.synchronize do
62
- @rates[rate_key_for(currency_iso_from, currency_iso_to)]
61
+ guard.synchronize do
62
+ rates[rate_key_for(currency_iso_from, currency_iso_to)]
63
63
  end
64
64
  end
65
65
 
66
66
  def marshal_dump
67
- @guard.synchronize do
68
- return [self.class, @options, @rates.dup]
67
+ guard.synchronize do
68
+ return [self.class, options, rates.dup]
69
69
  end
70
70
  end
71
71
 
72
72
  # Wraps block execution in a thread-safe transaction
73
73
  def transaction(&block)
74
- @guard.synchronize do
74
+ guard.synchronize do
75
75
  yield
76
76
  end
77
77
  end
@@ -91,8 +91,8 @@ class Money
91
91
  def each_rate(&block)
92
92
  return to_enum(:each_rate) unless block_given?
93
93
 
94
- @guard.synchronize do
95
- @rates.each do |key, rate|
94
+ guard.synchronize do
95
+ rates.each do |key, rate|
96
96
  iso_from, iso_to = key.split(INDEX_KEY_SEPARATOR)
97
97
  yield iso_from, iso_to, rate
98
98
  end
@@ -101,6 +101,8 @@ class Money
101
101
 
102
102
  private
103
103
 
104
+ attr_reader :rates, :options, :guard
105
+
104
106
  # Return the rate hashkey for the given currencies.
105
107
  #
106
108
  # @param [String] currency_iso_from The currency to exchange from.
@@ -1,3 +1,3 @@
1
1
  class Money
2
- VERSION = '6.13.5'
2
+ VERSION = '6.13.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: money
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.13.5
4
+ version: 6.13.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Emmons
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-12-01 00:00:00.000000000 Z
12
+ date: 2019-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n