money 6.4.0 → 6.5.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 +4 -4
- data/AUTHORS +9 -8
- data/CHANGELOG.md +1 -0
- data/README.md +3 -2
- data/config/currency_iso.json +4 -4
- data/lib/money/currency.rb +1 -1
- data/lib/money/money.rb +4 -4
- data/lib/money/version.rb +1 -1
- data/money.gemspec +1 -1
- data/spec/currency_spec.rb +7 -0
- data/spec/money/formatting_spec.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9de08a1673530ca427fb70f37d70526155a27d1
|
4
|
+
data.tar.gz: 2481e79b2b71853d316865cf7831d14b3738a67b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 603c5318cff748cd533db8dbd596eebf448d7f040bb8fd6f6c43c97eddff07da74b039864e7faf75d3abe4ba06fa933912ae949c1e814a183ee861b1401f3906
|
7
|
+
data.tar.gz: 5ffd14941b9f53f33e3dd731472cd7f9fc4c4831c353f1c970ec12ea50ce6fa7d9f088952439d1d69e11ab61ebaaedf261b717fca0147ad812061742b3e03eae
|
data/AUTHORS
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
Abhay Kumar
|
2
|
+
Adrian Longley
|
2
3
|
Alex Speller
|
3
4
|
Alexander Ross
|
4
5
|
Andreas Loupasakis
|
@@ -20,9 +21,12 @@ Chad Boyd
|
|
20
21
|
Choongmin Lee
|
21
22
|
Chris Kampmeier
|
22
23
|
Christian Billen
|
24
|
+
Clarke Brunsdon
|
23
25
|
Dave Kroondyk
|
26
|
+
Daniel Sherson
|
24
27
|
Doug Droper
|
25
28
|
Ed Saunders
|
29
|
+
Edwin Vlieg
|
26
30
|
Eloy
|
27
31
|
Evan Alter
|
28
32
|
Exoth
|
@@ -93,21 +97,18 @@ Simone Carletti
|
|
93
97
|
Spencer Rinehart
|
94
98
|
Steve Morris
|
95
99
|
Yok
|
100
|
+
Yuri Sidorov
|
101
|
+
Yuusuke Takizawa
|
96
102
|
Thomas E Enebo
|
97
103
|
Thomas Weymuth
|
98
104
|
Ticean Bennett
|
105
|
+
Tien Nguyen
|
99
106
|
Tim Hart
|
100
107
|
Tobias Luetke
|
101
108
|
Tobias Schmidt
|
102
109
|
Tom Lianza
|
103
110
|
tommeier
|
104
|
-
|
105
|
-
Adrian Longley
|
106
|
-
Daniel Sherson
|
107
|
-
Clarke Brunsdon
|
108
|
-
Yuusuke Takizawa
|
109
|
-
Tien Nguyen
|
111
|
+
Troels Knak-Nielsen
|
110
112
|
Wei Zhu
|
111
113
|
Zubin Henner
|
112
|
-
|
113
|
-
Edwin Vlieg
|
114
|
+
Бродяной Александр
|
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
- Switch default and alternate symbols for RUB currency
|
10
10
|
- Fix symbol for TRY currency
|
11
11
|
- Add `Money.default_formatting_rules` hash, meant to define default rules for everytime `Money#format` is called. They can be overwritten if provided on method call
|
12
|
+
- Add support for the new official symbol for Russian Ruble (RUB) — «₽»
|
12
13
|
|
13
14
|
## 6.2.1
|
14
15
|
- Ensure set is loaded
|
data/README.md
CHANGED
@@ -272,18 +272,19 @@ If you want thousands seperator and decimal mark to be same across all
|
|
272
272
|
currencies this can be defined in your `I18n` translation files.
|
273
273
|
|
274
274
|
In an rails application this may look like:
|
275
|
+
|
275
276
|
```yml
|
276
277
|
# config/locale/en.yml
|
277
278
|
en:
|
278
279
|
number:
|
279
280
|
format:
|
280
|
-
|
281
|
+
delimiter: ","
|
281
282
|
separator: "."
|
282
283
|
# or
|
283
284
|
number:
|
284
285
|
currency:
|
285
286
|
format:
|
286
|
-
|
287
|
+
delimiter: ","
|
287
288
|
separator: "."
|
288
289
|
```
|
289
290
|
|
data/config/currency_iso.json
CHANGED
@@ -1797,12 +1797,12 @@
|
|
1797
1797
|
"priority": 100,
|
1798
1798
|
"iso_code": "RUB",
|
1799
1799
|
"name": "Russian Ruble",
|
1800
|
-
"symbol": "
|
1801
|
-
"alternate_symbols": ["
|
1802
|
-
"subunit": "
|
1800
|
+
"symbol": "₽",
|
1801
|
+
"alternate_symbols": ["руб.", "р."],
|
1802
|
+
"subunit": "Kopeck",
|
1803
1803
|
"subunit_to_unit": 100,
|
1804
1804
|
"symbol_first": false,
|
1805
|
-
"html_entity": "&#
|
1805
|
+
"html_entity": "₽",
|
1806
1806
|
"decimal_mark": ",",
|
1807
1807
|
"thousands_separator": ".",
|
1808
1808
|
"iso_numeric": "643",
|
data/lib/money/currency.rb
CHANGED
data/lib/money/money.rb
CHANGED
@@ -21,8 +21,8 @@ class Money
|
|
21
21
|
|
22
22
|
# Convenience method for fractional part of the amount. Synonym of #fractional
|
23
23
|
#
|
24
|
-
# @return [Integer] when
|
25
|
-
# @return [BigDecimal] when
|
24
|
+
# @return [Integer] when infinite_precision is false
|
25
|
+
# @return [BigDecimal] when infinite_precision is true
|
26
26
|
#
|
27
27
|
# @see infinite_precision
|
28
28
|
def cents
|
@@ -41,8 +41,8 @@ class Money
|
|
41
41
|
# Money representation of one Kuwaiti Dinar, the fractional interpretation is
|
42
42
|
# 1000.
|
43
43
|
#
|
44
|
-
# @return [Integer] when
|
45
|
-
# @return [BigDecimal] when
|
44
|
+
# @return [Integer] when infinite_precision is false
|
45
|
+
# @return [BigDecimal] when infintie_precision is true
|
46
46
|
#
|
47
47
|
# @see infinite_precision
|
48
48
|
def fractional
|
data/lib/money/version.rb
CHANGED
data/money.gemspec
CHANGED
@@ -25,7 +25,7 @@ and choose the migration that best suits your application.
|
|
25
25
|
Test responsibly :-)
|
26
26
|
MSG
|
27
27
|
|
28
|
-
s.add_dependency 'i18n', ['>= 0.6.4', '<= 0.7.0
|
28
|
+
s.add_dependency 'i18n', ['>= 0.6.4', '<= 0.7.0']
|
29
29
|
|
30
30
|
s.add_development_dependency "bundler", "~> 1.3"
|
31
31
|
s.add_development_dependency "rake"
|
data/spec/currency_spec.rb
CHANGED
@@ -6,6 +6,13 @@ describe Money::Currency do
|
|
6
6
|
|
7
7
|
FOO = '{ "priority": 1, "iso_code": "FOO", "iso_numeric": "840", "name": "United States Dollar", "symbol": "$", "subunit": "Cent", "subunit_to_unit": 450, "symbol_first": true, "html_entity": "$", "decimal_mark": ".", "thousands_separator": ",", "smallest_denomination": 1 }'
|
8
8
|
|
9
|
+
|
10
|
+
describe "UnknownMoney::Currency" do
|
11
|
+
it "is a subclass of ArgumentError" do
|
12
|
+
expect(Money::Currency::UnknownCurrency < ArgumentError).to be true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
9
16
|
describe ".find" do
|
10
17
|
before :each do
|
11
18
|
Money::Currency.register(JSON.parse(FOO, :symbolize_names => true))
|
@@ -225,13 +225,13 @@ describe Money, "formatting" do
|
|
225
225
|
it "inserts thousand separators if symbol contains decimal mark and no_cents is true" do
|
226
226
|
expect(Money.new(100000000, "AMD").format(:no_cents => true)).to eq "1,000,000 դր."
|
227
227
|
expect(Money.new(100000000, "USD").format(:no_cents => true)).to eq "$1,000,000"
|
228
|
-
expect(Money.new(100000000, "RUB").format(:no_cents => true)).to eq "1.000.000
|
228
|
+
expect(Money.new(100000000, "RUB").format(:no_cents => true)).to eq "1.000.000 ₽"
|
229
229
|
end
|
230
230
|
|
231
231
|
it "doesn't incorrectly format HTML" do
|
232
232
|
money = ::Money.new(1999, "RUB")
|
233
233
|
output = money.format(:html => true, :no_cents => true)
|
234
|
-
expect(output).to eq "19 &#
|
234
|
+
expect(output).to eq "19 ₽"
|
235
235
|
end
|
236
236
|
end
|
237
237
|
|
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.
|
4
|
+
version: 6.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Emmons
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 0.6.4
|
20
20
|
- - "<="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.7.0
|
22
|
+
version: 0.7.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 0.6.4
|
30
30
|
- - "<="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.7.0
|
32
|
+
version: 0.7.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|