money 6.4.0 → 6.5.0

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: 5b17085ec48ad637f79d50632f0f33a940e17a22
4
- data.tar.gz: 76f462a0d1b62562694324fb4f97d96d5c101765
3
+ metadata.gz: b9de08a1673530ca427fb70f37d70526155a27d1
4
+ data.tar.gz: 2481e79b2b71853d316865cf7831d14b3738a67b
5
5
  SHA512:
6
- metadata.gz: dd0bc7415006f620e9e5bea076d2248d63353c82cca3ca11e8c3c29ab6420b1ed6163b6042cc743035a017be2178f48ba07014594edda8b1e4ee3d133949d399
7
- data.tar.gz: 742631af8dff373d776438ce74d99ac01437387046e87cb8a3ef68498fc3d2fe64860a4f9d6280fb70ccc4c94df8fb3c0b84e0ff4a4e5f6ca115e6d5beb4892a
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
- Troels Knak-Nielsen
113
- Edwin Vlieg
114
+ Бродяной Александр
@@ -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
- delimeter: ","
281
+ delimiter: ","
281
282
  separator: "."
282
283
  # or
283
284
  number:
284
285
  currency:
285
286
  format:
286
- delimeter: ","
287
+ delimiter: ","
287
288
  separator: "."
288
289
  ```
289
290
 
@@ -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": "Kopek",
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",
@@ -16,7 +16,7 @@ class Money
16
16
  extend Money::Currency::Heuristics
17
17
 
18
18
  # Thrown when an unknown currency is requested.
19
- class UnknownCurrency < StandardError; end
19
+ class UnknownCurrency < ArgumentError; end
20
20
 
21
21
  class << self
22
22
 
@@ -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 inifinte_precision is false
25
- # @return [BigDecimal] when inifinte_precision is true
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 inifinte_precision is false
45
- # @return [BigDecimal] when inifinte_precision is true
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
@@ -1,3 +1,3 @@
1
1
  class Money
2
- VERSION = "6.4.0"
2
+ VERSION = "6.5.0"
3
3
  end
@@ -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.beta1']
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"
@@ -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 &#x0440;&#x0443;&#x0431;"
234
+ expect(output).to eq "19 &#x20BD;"
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.0
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-10-30 00:00:00.000000000 Z
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.beta1
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.beta1
32
+ version: 0.7.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement