money 6.10.0 → 6.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19c937d927f70901c2a2deda19899ec893b567b1
4
- data.tar.gz: 213e8242c26aadfb1030453815547765ea030022
3
+ metadata.gz: c2e4b452eb189b014f2807754a5be04f71419c60
4
+ data.tar.gz: f94facfe0d9f541b0f3e1cae4cb94c1be7b9775d
5
5
  SHA512:
6
- metadata.gz: 0bb443e04dccacd832fd53fad627eb4076b895a79da97adb29c32407689ddb53a95e3dc4e36ab8e9e5b5f764a13a3a579ea887a53ee748e2c60dea05ef882596
7
- data.tar.gz: dce49cc4288a72a187ca03d709abd9659d9dab3965ade09fe5f86c69034a09a5106f4da57da2d3201233f256c1353a2661d95b70f2deb19cede3a6d4ac022ec4
6
+ metadata.gz: '008425091a080a8b13e96cb593863bb12bc7041de755686b27065de0d2b36830b2cbd5abd8c7e38424995511856a501d483557a3e4a20708669806917395fcfb'
7
+ data.tar.gz: 6db8674c8037f772efc5ebfbdbaf680db6a9778d2a0f6fa9abe95b6d7802bb570efc4ae22b2b1d7f0c4385d9a35b38b6acf33f6b4d8e87d34cbbceeb5a4d8751
data/AUTHORS CHANGED
@@ -36,6 +36,7 @@ Filipe Goncalves
36
36
  Francisco Trindade
37
37
  François Beausoleil
38
38
  François Klingler
39
+ Fred Liang
39
40
  Gabriel Gilder
40
41
  Gee-Hsien Chuang
41
42
  George Millo
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.10.1
4
+ - Fix an issue with Money.empty memoization
5
+
3
6
  ## 6.10.0
4
7
  - Added support for i18n version 0.9
5
8
  - Disabled rounding when verifying allocation splits
@@ -11,6 +11,7 @@ class Money
11
11
  # Money.empty #=> #<Money @fractional=0>
12
12
  def empty(currency = default_currency)
13
13
  @empty ||= {}
14
+ currency = Currency.new(currency)
14
15
  @empty[currency] ||= new(0, currency).freeze
15
16
  end
16
17
  alias_method :zero, :empty
@@ -1,3 +1,3 @@
1
1
  class Money
2
- VERSION = '6.10.0'
2
+ VERSION = '6.10.1'
3
3
  end
@@ -19,6 +19,14 @@ describe Money::Constructors do
19
19
  expect(Money.empty).to be_frozen
20
20
  end
21
21
 
22
+ it "always use Currency object to memoize Money objects" do
23
+ Money.instance_variable_set(:@empty, {})
24
+ expect {
25
+ Money.zero(:usd)
26
+ Money.zero
27
+ }.to_not raise_error
28
+ end
29
+
22
30
  it "instantiates a subclass when inheritance is used" do
23
31
  special_money_class = Class.new(Money)
24
32
  expect(special_money_class.empty).to be_a special_money_class
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: money
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.10.0
4
+ version: 6.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Emmons
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-04 00:00:00.000000000 Z
11
+ date: 2017-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n