money2 7.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +23 -0
- data/.rspec +1 -0
- data/.travis.yml +24 -0
- data/AUTHORS +126 -0
- data/CHANGELOG.md +619 -0
- data/CONTRIBUTING.md +17 -0
- data/Gemfile +16 -0
- data/LICENSE +23 -0
- data/README.md +438 -0
- data/Rakefile +17 -0
- data/config/currency_backwards_compatible.json +107 -0
- data/config/currency_iso.json +2449 -0
- data/config/currency_non_iso.json +66 -0
- data/lib/money.rb +390 -0
- data/lib/money/allocate.rb +86 -0
- data/lib/money/arithmetic.rb +233 -0
- data/lib/money/bank/base.rb +137 -0
- data/lib/money/bank/single_currency.rb +25 -0
- data/lib/money/bank/variable_exchange.rb +252 -0
- data/lib/money/class_attribute.rb +26 -0
- data/lib/money/currency.rb +402 -0
- data/lib/money/currency/heuristics.rb +150 -0
- data/lib/money/currency/loader.rb +29 -0
- data/lib/money/currency_methods.rb +139 -0
- data/lib/money/formatter.rb +404 -0
- data/lib/money/formatter/to_string.rb +9 -0
- data/lib/money/rates_store/memory.rb +120 -0
- data/lib/money/unaccent.rb +18 -0
- data/lib/money/v6_compatibility.rb +5 -0
- data/lib/money/v6_compatibility/arithmetic.rb +61 -0
- data/lib/money/v6_compatibility/bank_rounding_block.rb +38 -0
- data/lib/money/v6_compatibility/currency_id.rb +29 -0
- data/lib/money/v6_compatibility/format.rb +53 -0
- data/lib/money/v6_compatibility/fractional.rb +74 -0
- data/lib/money/version.rb +3 -0
- data/lib/money2.rb +1 -0
- data/money.gemspec +31 -0
- metadata +207 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d67ed149191c0e327b2f5c9a33d57fcb7bd2b39e
|
4
|
+
data.tar.gz: 9c81d91c7dce21d23d2e40a96ab2e9d450df8601
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b58163e0ce51a72d7773aba38923400e72dbce3a8d1520f239b3b26b153b6038ef8accbc3c44c7abf52d0f915764d046dd988d4d9b626ef7d7ca7535bf3d312c
|
7
|
+
data.tar.gz: d7147374a66c46961242f81c582eacbcbb8da1a3f428b2bd0a813ff6cb0a474f5771a5e11fcdba2b1db5b947b22681e4d1981ea20b92a78a9926736f9bdf41a7
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
repo_token: lUJ1iIe2hjtyIFZm413PZ38saqD5UOLXo
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Bundler
|
2
|
+
.bundle
|
3
|
+
Gemfile.lock
|
4
|
+
pkg/*
|
5
|
+
bin/
|
6
|
+
|
7
|
+
# Rubinius
|
8
|
+
*.rbc
|
9
|
+
|
10
|
+
# YARD
|
11
|
+
.yardoc
|
12
|
+
yardoc/
|
13
|
+
doc/
|
14
|
+
|
15
|
+
# Project
|
16
|
+
.rbenv-version
|
17
|
+
.rbx
|
18
|
+
.rvmrc
|
19
|
+
.ruby-version
|
20
|
+
.ruby-gemset
|
21
|
+
|
22
|
+
# Spec artifacts
|
23
|
+
/coverage
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.travis.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
language: ruby
|
2
|
+
sudo: false
|
3
|
+
rvm:
|
4
|
+
- 2.0.0
|
5
|
+
- 2.1.10
|
6
|
+
- 2.2.5
|
7
|
+
- 2.3.1
|
8
|
+
- rbx-2
|
9
|
+
- jruby-9.0.5.0
|
10
|
+
- jruby-9.1.2.0
|
11
|
+
- ruby-head
|
12
|
+
- jruby-head
|
13
|
+
matrix:
|
14
|
+
allow_failures:
|
15
|
+
- rvm: ruby-head
|
16
|
+
- rvm: jruby-head
|
17
|
+
- rvm: rbx-2
|
18
|
+
fast_finish: true
|
19
|
+
script: bundle exec rspec spec
|
20
|
+
notifications:
|
21
|
+
email:
|
22
|
+
- semmons99@gmail.com
|
23
|
+
- andreas@aloop.org
|
24
|
+
- weppos@weppos.net
|
data/AUTHORS
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
Abhay Kumar
|
2
|
+
Adrian Longley
|
3
|
+
Alexander Ross
|
4
|
+
Alex Speller
|
5
|
+
Andreas Loupasakis
|
6
|
+
Andrei
|
7
|
+
Andrew White
|
8
|
+
Andrius Chamentauskas
|
9
|
+
Anthony Hristov
|
10
|
+
Anthony Sellitti
|
11
|
+
banjerluke
|
12
|
+
Bartosz Dz
|
13
|
+
bbozo
|
14
|
+
Benjamin Grössing
|
15
|
+
Bill DeRusha
|
16
|
+
Bodaniel Jeanes
|
17
|
+
Brian Jones
|
18
|
+
bUg.
|
19
|
+
Cade Truitt
|
20
|
+
Casper Thomsen
|
21
|
+
Chad Boyd
|
22
|
+
Choongmin Lee
|
23
|
+
Chris Kampmeier
|
24
|
+
Christian Billen
|
25
|
+
Clarke Brunsdon
|
26
|
+
Daniel Sherson
|
27
|
+
Dave Kroondyk
|
28
|
+
Doug Droper
|
29
|
+
Douglas Miller
|
30
|
+
Ed Saunders
|
31
|
+
Edwin Vlieg
|
32
|
+
Eloy
|
33
|
+
Evan Alter
|
34
|
+
Exoth
|
35
|
+
Filipe Goncalves
|
36
|
+
Francisco Trindade
|
37
|
+
François Beausoleil
|
38
|
+
François Klingler
|
39
|
+
Gabriel Gilder
|
40
|
+
Gee-Hsien Chuang
|
41
|
+
George Millo
|
42
|
+
Hakan Ensari
|
43
|
+
Hongli Lai
|
44
|
+
Ilia Lobsanov
|
45
|
+
Ingo Wichmann
|
46
|
+
Jacob Atzen
|
47
|
+
James Cotterill
|
48
|
+
James Hunt
|
49
|
+
Jean-Louis Giordano
|
50
|
+
Jean-Philippe Doyle
|
51
|
+
Jell
|
52
|
+
Jérémy Lecour
|
53
|
+
Jeremy McNevin
|
54
|
+
Jesse Cooke
|
55
|
+
Jim Kingdon
|
56
|
+
John Duff
|
57
|
+
John Gakos
|
58
|
+
Jonathon M. Abbott
|
59
|
+
Josh Delsman
|
60
|
+
Josh Hepworth
|
61
|
+
Joshua Clayton
|
62
|
+
Julien Boyer
|
63
|
+
Kaleem Ullah
|
64
|
+
Kenichi Kamiya
|
65
|
+
Kenn Ejima
|
66
|
+
kirillian
|
67
|
+
Laurynas Butkus
|
68
|
+
Marcel Scherf
|
69
|
+
Marco Otte-Witte
|
70
|
+
Mateus Gomes
|
71
|
+
Mateusz Wolsza
|
72
|
+
Matias Korhonen
|
73
|
+
Matthew McEachen
|
74
|
+
Matt Jankowski
|
75
|
+
Max Melentiev
|
76
|
+
Michael Irwin
|
77
|
+
Michael J. Cohen
|
78
|
+
Michael Reinsch
|
79
|
+
Michael Rodrigues
|
80
|
+
Mikael Wikman
|
81
|
+
Mike Herrera
|
82
|
+
Mike Połétyn
|
83
|
+
Musannif Zahir
|
84
|
+
Neil Middleton
|
85
|
+
Nihad Abbasov
|
86
|
+
Olek Janiszewski
|
87
|
+
Orien Madgwick
|
88
|
+
Paul McMahon
|
89
|
+
Paulo Diniz
|
90
|
+
Pavan Sudarshan
|
91
|
+
Pavel Gabriel
|
92
|
+
pconnor
|
93
|
+
Pedro Nascimento
|
94
|
+
Pelle Braendgaard
|
95
|
+
Peter Rhoades
|
96
|
+
Phil Cohen
|
97
|
+
pivotal-cloudplanner
|
98
|
+
Prathan Thananart
|
99
|
+
Robert Starsi
|
100
|
+
Romain Gérard
|
101
|
+
Ryan Bigg
|
102
|
+
sankaranarayanan
|
103
|
+
Scott Pierce
|
104
|
+
Semyon Perepelitsa
|
105
|
+
Shane Emmons
|
106
|
+
Simone Carletti
|
107
|
+
Spencer Rinehart
|
108
|
+
Steve Morris
|
109
|
+
Thomas E Enebo
|
110
|
+
Thomas Weymuth
|
111
|
+
Ticean Bennett
|
112
|
+
Tien Nguyen
|
113
|
+
Tim Hart
|
114
|
+
Tobias Luetke
|
115
|
+
Tobias Schmidt
|
116
|
+
Tom Lianza
|
117
|
+
tommeier
|
118
|
+
Troels Knak-Nielsen
|
119
|
+
Tsyren Ochirov
|
120
|
+
Victor Shcherbakov
|
121
|
+
Wei Zhu
|
122
|
+
Yok
|
123
|
+
Yuri Sidorov
|
124
|
+
Yuusuke Takizawa
|
125
|
+
Zubin Henner
|
126
|
+
Бродяной Александр
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,619 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 7.0.0.rc1
|
4
|
+
|
5
|
+
- Moved `lib/money/money/* -> lib/money`.
|
6
|
+
- Formatting specific methods moved to Formatter.
|
7
|
+
- `default_formatting_rules` & `use_i18n` moved to Formatter.
|
8
|
+
- `Formatter.default_rules=` doesn't support nil (hash must be given).
|
9
|
+
- Remove `#currency_as_string`.
|
10
|
+
- Lambda passed to `.default_currency` must return currency object (not symbol).
|
11
|
+
- Rename `Currency#iso_code -> #code`
|
12
|
+
- Set `Currency#code` same as id (YEN to get JPY, and GHC for GHS will not be supported)
|
13
|
+
- Improved and cleaned up default formatter (2x faster) & `#to_s`.
|
14
|
+
- changed empty `Currency.html_entity` to nil
|
15
|
+
- renamed options, dropped fallbacks:
|
16
|
+
- `south_asian_number_formatting => south_asian`
|
17
|
+
- `translate => translate_symbol`
|
18
|
+
- `thousands_separator => delimiter`
|
19
|
+
- `decimal_mark => separator`
|
20
|
+
- `symbol_after_without_space, symbol_before_without_space => symbol_space`
|
21
|
+
- Simplify arithmetics (encourage using to_d).
|
22
|
+
- Use whole amounts (not cents) as main value.
|
23
|
+
- Rounding block to `Bank#exchange_with` receives decimal amount and currency so
|
24
|
+
it must be changed to ` ->(value, currency) { value.round(currency.decimal_places) }`.
|
25
|
+
- Don't depend on `sixarm_ruby_unaccent`. Add it to your Gemfile if you use `Currency.analyze`.
|
26
|
+
- `Currency.keep_only` to cleanup currencies.
|
27
|
+
|
28
|
+
## 6.7.1
|
29
|
+
- Changed DKK symbol from 'kr' to 'kr.'
|
30
|
+
- Improved Money::Formatting#format docs
|
31
|
+
- Updated VEF symbol from 'Bs F' to 'Bs'
|
32
|
+
- `Currency#exponent` now returns Fixnum
|
33
|
+
- Fixed coercion issues
|
34
|
+
- Fixed edge case with explicit override of thousands separator and decimal mark
|
35
|
+
- `Money#==` will now raise error for non-zero numeric values
|
36
|
+
- Fixed divmod
|
37
|
+
- Added disambiguation symbol to USD Dollar
|
38
|
+
- Use disambiguation symbol when both disambiguate and symbol are true in `format` method
|
39
|
+
|
40
|
+
## 6.7.0
|
41
|
+
- Changed `Money#<=>` to return `nil` if the comparison is inappropriate. (#584)
|
42
|
+
- Remove implicit conversion of values being compared. Only accept `Money` and
|
43
|
+
subclasses of `Money` for comparisons and raise TypeError otherwise.
|
44
|
+
- When comparing fails due to `Money::Bank::UnknownRate` `Money#<=>` will now
|
45
|
+
return `nil` as `Comparable#==` will not rescue exceptions in the next release.
|
46
|
+
- Fix `Currency` specs for `#exponent` and `#decimal_places` not making assertions.
|
47
|
+
- Fix a couple of Ruby warnings found in specs.
|
48
|
+
- Fix `Money#-`,`Money#+` arithmetics for Ruby 2.3+ : check for zero value without using eql? with a Fixnum. (#577)
|
49
|
+
- Use `Money#decimal_mark` when formatting with `rounded_infinite_precision` rule
|
50
|
+
set to `true`.
|
51
|
+
- Replaced meta-defined `thousands_separator` and `decimal_mark` methods with regular methods. (#579)
|
52
|
+
|
53
|
+
## 6.6.0
|
54
|
+
- Fixed VariableExchange#exchange_with for big numbers.
|
55
|
+
- Add Currency symbol translation support
|
56
|
+
- `Currency.all` raises a more helpful error message
|
57
|
+
(`Currency::MissingAttributeError`)if a currency has no priority
|
58
|
+
- `Currency` implements `Enumerable`.
|
59
|
+
- `Currency#<=>` sorts alphabetically by `id` if the `priority`s are the same,
|
60
|
+
and no longer raises an error if one of the priorities is missing.
|
61
|
+
- `Money::Currency.unregister` can take an ISO code argument in addition
|
62
|
+
to a hash.
|
63
|
+
- `Money::Currency.unregister` returns `true` if the given currency
|
64
|
+
previously existed, and `false` if it didn't.
|
65
|
+
- Fix symbol for SZL currency
|
66
|
+
- Trying to create a Currency without an `iso_code` now raises a more
|
67
|
+
helpful error message.
|
68
|
+
- Add `Money.usd`, `.cad` and `.eur` as aliases for `.us_dollar`,
|
69
|
+
`.ca_dollar`, and `.euro`.
|
70
|
+
- Add helper methods for British pounds: `Money.pound_sterling` and
|
71
|
+
`Money.gbp`.
|
72
|
+
- Add `Money.from_amount` to create money from a value in units instead of
|
73
|
+
fractional units.
|
74
|
+
- Changed CHF symbol from 'Fr' to 'CHF'
|
75
|
+
- Changed CLF exponent from 0 to 4
|
76
|
+
- Changed CLP subunit_to_unit from 1 to 100
|
77
|
+
- Minor fixes to prevent warnings on unused variables and the redefinition of
|
78
|
+
`Money.default_currency`
|
79
|
+
- `Money#==` changed to acknowledge that 0 in one currency is equal to 0 in any currency.
|
80
|
+
- Changed KRW subunit_to_unit from 100 to 1
|
81
|
+
- Decouple exchange rates storage from bank objects and formalize storage public API. Default is `Money::RatesStore::Memory`.
|
82
|
+
- `Currency.new` now a singleton by its id
|
83
|
+
|
84
|
+
## 6.5.1
|
85
|
+
- Fix format for BYR currency
|
86
|
+
|
87
|
+
## 6.5.0
|
88
|
+
- Add method to round a given amount of money to the nearest possible value in cash (aka Swedish rounding).
|
89
|
+
- Fixed the subunit_to_unit values of the CLP and KRW currencies
|
90
|
+
- Add option for `disambiguate` symbols for formatting
|
91
|
+
- Fixed the subunit_to_unit values of the VND currency
|
92
|
+
- Fix formatting of NGN - show symbol before amount
|
93
|
+
- Switch default and alternate symbols for RUB currency
|
94
|
+
- Fix symbol for TRY currency
|
95
|
+
- 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
|
96
|
+
- Add support for the new official symbol for Russian Ruble (RUB) — «₽»
|
97
|
+
|
98
|
+
## 6.2.1
|
99
|
+
- Ensure set is loaded
|
100
|
+
|
101
|
+
## 6.2.0
|
102
|
+
- Fixes formatting error when both `thousands_separator` and `decimal_mark` was added to Money#format as options.
|
103
|
+
- Add Money#to_i which returns the whole part of the value. i.e.
|
104
|
+
Money.new(100, "USD").to_i # => 1
|
105
|
+
- Fix output on Ukrainian Hryvnia symbol in HTML.
|
106
|
+
- Add documentation about i18n in README.
|
107
|
+
- Update iso code, symbol, subunit for the new Turkmenistani manat (GH-181)
|
108
|
+
- Performance Improvements (1.99x faster on MRI, 1.85x on Rubinius, 41.4x faster on JRuby)
|
109
|
+
- Money can now add and subtract Fixnum 0
|
110
|
+
- Money#new uses Money.default_currency if currency arg is nil (GH-410)
|
111
|
+
- Fixed formatting of NOK, putting the symbol after numbers
|
112
|
+
- Fixed issue where rounded_infinite_precision formatting fails for some localized currencies (GH-422)
|
113
|
+
|
114
|
+
## 6.1.1
|
115
|
+
- Remove lingering Monetize call
|
116
|
+
|
117
|
+
## 6.1.0
|
118
|
+
- Remove deprecated methods.
|
119
|
+
- Fix issue with block form of rounding_mode.
|
120
|
+
|
121
|
+
## 6.0.1
|
122
|
+
- Deprecated methods lists caller on print out for easier updating.
|
123
|
+
- Added support for Money::Currency#to_str and Money::Currency#to_sym
|
124
|
+
- Added ability to temporally change the rounding methond inside a given block
|
125
|
+
- Replaced parsing and core extensions with the monetize gem
|
126
|
+
|
127
|
+
## 6.0.0
|
128
|
+
- Fix BTC subunit
|
129
|
+
- New option :sign_positive to add a + sign to positive numbers
|
130
|
+
- Only allow to multiply a money by a number (int, float)
|
131
|
+
- Fix typo
|
132
|
+
- Wrap the currency symbol in a span if :html is specified in the rules
|
133
|
+
- Added Money::Currency.all method
|
134
|
+
- Allow combined comparison operator to handle zero values without rates
|
135
|
+
- Added Money::Currency.unregister method
|
136
|
+
- Works on Ruby 1.8.7
|
137
|
+
- Update deps
|
138
|
+
- Depreciate Money.parse
|
139
|
+
- Passing :symbol => false when formatting 'JPY' currency in :ja locale
|
140
|
+
will work as expected
|
141
|
+
- Divide now obeys the specified rounding mode
|
142
|
+
- Add Money#round method. This is helpful when working in infinite_precision mode and would like to perform rounding at specific points in your work flow.
|
143
|
+
- In infinite precision mode, deserialized Money objects no longer return Float values from the `fractional` method.
|
144
|
+
- Changed `thousands_separator` for Swedish Krona from dot to blank space.
|
145
|
+
- Allow mathematical operations with first argument being not an instance of Money (eg. 2 * money instead of money * 2).
|
146
|
+
- Money#dollars and Money#amount methods return numbers of type BigDecimal.
|
147
|
+
- Change Money.from_bigdecimal (and in that way .to_money too) to keep precision when using `Money.infinite_precision = true`
|
148
|
+
- Add :rounded_infinite_precision option to .format
|
149
|
+
- Changed the New Taiwan Dollar symbol position from after the amount to before the amount.
|
150
|
+
- Passing a Money instance to the Money constructor will obtain a new Money object with the same property values as the original
|
151
|
+
- Add deprecation warning to comparators
|
152
|
+
- Add Money.disallow_currency_conversion! option
|
153
|
+
- Allow to inherits from `Money`
|
154
|
+
|
155
|
+
## 5.1.1
|
156
|
+
|
157
|
+
- Added :sign_before_symbol option to format negative numbers as -£1 rather than £-1
|
158
|
+
- Ensure BigDecimal.new always receives a string - compatibility fix for ruby-1.9.2-p320
|
159
|
+
- Update Maldivian Currency to MVR and fix ރ. to be ރ
|
160
|
+
- Add exponent to currency
|
161
|
+
- Add find_numeric to find currencies by ISO 4217 numeric code.
|
162
|
+
- Fixed regression where thousands separator was missing on certain currencies. (GH-245)
|
163
|
+
- Added :symbol_before_without_space option to add a space between currency symbol and amount.
|
164
|
+
|
165
|
+
## 5.1.0
|
166
|
+
|
167
|
+
- Fix currency assumption when parsing $ with a non-USD default currency.
|
168
|
+
- Changed the Bulgarian lev symbol position from before the amount to after the amount.
|
169
|
+
- Changed the symbol and html entity for INR. It is now "₹" instead of "₨".
|
170
|
+
- Added Money::Currency.analyze for determining potential currencies for a given string using powereful algorithms - will detect symbols, iso codes and names even if mixed with text.
|
171
|
+
- Changed UGX symbol from 'Sh' to 'USh'.
|
172
|
+
- Changed SYP symbol from "£ or ل.س" to "£S". The previous symbols remain as alternates.
|
173
|
+
- Changed RWF symbol from 'FR' to 'FRw'.
|
174
|
+
- Changed RSD symbol from "din. or дин." to 'РСД'. The previous symbols remain as alternates.
|
175
|
+
- Added MGA symbol 'Ar'
|
176
|
+
- Added KGS symbol 'som'
|
177
|
+
- Changed KES symbol from 'Sh' to 'KSh'
|
178
|
+
- Added ETB symbol 'Br'
|
179
|
+
- Changed EGP symbol from "£ or ج.م" to "ج.م"
|
180
|
+
- Changed DJF symbol from 'Fr' to 'Fdj'
|
181
|
+
- Changed CVE symbol from '$ or Esc' to '$'. 'Esc' remains as an alternate symbol.
|
182
|
+
- Added BTN symbol 'Nu.'
|
183
|
+
- Changed BAM symbol from 'KM or КМ' to 'КМ', the alternate (cyrillic script) remains as an alternate symbol.
|
184
|
+
- Added alternate symbols for all currencies. For example, USD can be written as both '$' and 'US$', SEK can be 'Kr' or ':-', etc.
|
185
|
+
- Renamed Money#cents to Money#fractional. Money#cents can still be used as a synonym and equivalent of Money#fractional.
|
186
|
+
- Added Money.new_with_amount and Money#amount. Money.new_with_dollars and Money#dollars remain as synonyms.
|
187
|
+
- Calling Bank::Base.instance doesn't make Bank::VariableExchange.instance
|
188
|
+
return Bank::Base.instance anymore (semaperepelitsa)
|
189
|
+
- Update Turkmenistan manat from TMM to TMT currency (GH-181). [Thanks @Exoth]
|
190
|
+
- Moved ZWD Zimbabwean dollars to currency_bc.json, also added there ZWL, ZWN, and ZWR Zimbabwean dollars (GH-184).
|
191
|
+
- Switch to multi_json gem (GH-170)
|
192
|
+
- Fix "warning: ambiguous first argument..." (GH-166)
|
193
|
+
- Update dependencies to latest and greatest (GH-172)
|
194
|
+
- TravisBot is now watching Pull Request!!! (GH-171)
|
195
|
+
- Minor code cleaning
|
196
|
+
- Remove subunit from South Korean won (KRW)
|
197
|
+
- Fixed bug where bankers rounding wasn't being used everywhere.
|
198
|
+
|
199
|
+
## 5.0.0
|
200
|
+
|
201
|
+
- Minor bugfix - incorrect use of character range resulted in
|
202
|
+
botched results for Money::Parsing#extract_cents (GH-162)
|
203
|
+
- Money::Currency::TABLE removed. Use Money::Currency.register to add
|
204
|
+
additional currencies (GH-143)
|
205
|
+
- Fix rounding error in Numeric.to_money (GH-145)
|
206
|
+
- Allow on-the-fly calculation of decimal places if not known already
|
207
|
+
(GH-146,GH-147,GH-148)
|
208
|
+
- Move Euro symbol ahead of amount (GH-151)
|
209
|
+
- Changed settings for Polish currency (GH-152)
|
210
|
+
- Fall back to symbol if there is no html_entity present (GH-153)
|
211
|
+
- Optionally Allow parsing of money values prefixed by symbols in key
|
212
|
+
currencies (GH-155)
|
213
|
+
- Fix bug where rates exported to a file from VariableExchange leave the File
|
214
|
+
object open (GH-154)
|
215
|
+
- Added Money#positive? and Money#negative? methods (GH-157)
|
216
|
+
- Fix format function output for custom currencies (GH-156)
|
217
|
+
- Fix parsing of strings with 3 decimal digits (GH-158)
|
218
|
+
- Updated development dependencies
|
219
|
+
- Said goodbye to RubyForge
|
220
|
+
|
221
|
+
## 4.0.2
|
222
|
+
|
223
|
+
- Money.to_money now understands a currency option (GH-121)
|
224
|
+
- Added Money#-@ method to change object polarity (GH-122)
|
225
|
+
- Added Money#symbol_or_iso_code utility method (GH-128)
|
226
|
+
- Money.parse now understands trailing - as negative inputs (GH-133)
|
227
|
+
- Money::Currency.new now validates input to avoid memory leaks (GH-137)
|
228
|
+
|
229
|
+
- Forced UTF-8 encoding on currency JSON (GH-117)
|
230
|
+
- Fixed position of Philippine peso sign (GH-124)
|
231
|
+
- Fixed position of Danish currency sign (GH-127)
|
232
|
+
|
233
|
+
## 4.0.1
|
234
|
+
|
235
|
+
- Add missing config dir.
|
236
|
+
|
237
|
+
Money 4.0.0
|
238
|
+
===========
|
239
|
+
|
240
|
+
The big change this release is moving the currency information into a JSON
|
241
|
+
file. This should make it easier for users to add and test things. Thanks to
|
242
|
+
Steve Morris for working on this during his Mendicant University course.
|
243
|
+
|
244
|
+
In addition to this big change there were well over a dozen other minor
|
245
|
+
changes.
|
246
|
+
|
247
|
+
Features
|
248
|
+
--------
|
249
|
+
- a new exchange bank nordea has been added to the README. (k33l0r)
|
250
|
+
- a new exchange bank nbrb_currency has been added to the README. (slbug)
|
251
|
+
- update Rake tasks
|
252
|
+
- See our CI status in the README
|
253
|
+
- Add syntax highlighting to the README (phlipper)
|
254
|
+
- Remove minor unit from YEN (pwim)
|
255
|
+
- Format YEN (pwim)
|
256
|
+
- Update README for `_as_string` (mjankowski)
|
257
|
+
- Update Lebanon currency (kaleemullah)
|
258
|
+
- Update Polish złoty (holek)
|
259
|
+
- Move currency information into JSON storage! (stevemorris)
|
260
|
+
- Add ISO4217 Numeric codes (alovak)
|
261
|
+
|
262
|
+
Bugfixes
|
263
|
+
--------
|
264
|
+
- EEK currency is no longer used, kept for BC ([#issue/110](http://github.com/RubyMoney/money/issues/110))
|
265
|
+
- Lithuanian Litas symbol position fixed (laurynas)
|
266
|
+
- Fixed README typos (phlipper)
|
267
|
+
- Fixed README typos (pwim)
|
268
|
+
- Fix specs (alovak)
|
269
|
+
|
270
|
+
Money 3.7.1
|
271
|
+
===========
|
272
|
+
|
273
|
+
Bugfixes
|
274
|
+
--------
|
275
|
+
- Add encoding indicator to top of Gemspec
|
276
|
+
|
277
|
+
Money 3.7.0
|
278
|
+
===========
|
279
|
+
|
280
|
+
Features
|
281
|
+
--------
|
282
|
+
- add Money#to_d (thanks Andrew White)
|
283
|
+
- Add Money.use_i18n, this allows you to enable/disable i18n from being used,
|
284
|
+
even if it's required in your app.
|
285
|
+
|
286
|
+
Money 3.6.2
|
287
|
+
===========
|
288
|
+
|
289
|
+
Features
|
290
|
+
--------
|
291
|
+
- i18n enhancements (thanks eloyesp [link](https://github.com/RubyMoney/money/commit/b2cab76c78ae04f40251fa20c4ab18faa968dc53))
|
292
|
+
- README updates (thanks pconnor)
|
293
|
+
- Break into modules
|
294
|
+
- Added `:no_cents_if_whole` format option
|
295
|
+
- Update HKD from Ho to Cent
|
296
|
+
- Performance improvements (thanks weppos)
|
297
|
+
- Added Symbol#to_currency
|
298
|
+
- Added Gemfile for development
|
299
|
+
- Updated HUF currency to use `symbol_first => false`
|
300
|
+
- Updated "Turkish New Lira" to "Turkish Lira"
|
301
|
+
|
302
|
+
Money 3.6.1
|
303
|
+
===========
|
304
|
+
|
305
|
+
Bugfixes
|
306
|
+
--------
|
307
|
+
- Floating point comparison needs to Epsilon aware (thanks Tobias Luetke)
|
308
|
+
- reimplement fix for #issue/43, enable Marshal.(load/dump)
|
309
|
+
|
310
|
+
Money 3.6.0
|
311
|
+
===========
|
312
|
+
|
313
|
+
Features
|
314
|
+
--------
|
315
|
+
- Add a symbol position option for Money#format (thanks Romain, Gil and
|
316
|
+
Julien)
|
317
|
+
- Updated CNY to use "Fen" and subunit_to_unit of 100
|
318
|
+
- Updates to work with gem-testers.org
|
319
|
+
|
320
|
+
Bugfixes
|
321
|
+
--------
|
322
|
+
- Fixed issue with #format(:no_cents => true) (thanks Romain & Julien)
|
323
|
+
|
324
|
+
Money 3.5.5
|
325
|
+
===========
|
326
|
+
|
327
|
+
Features
|
328
|
+
--------
|
329
|
+
- Enhancements to Money::Currency (thanks Matthew McEachen)
|
330
|
+
- Replace delimiter with thousands_separator
|
331
|
+
- Replace separator with decimal_mark
|
332
|
+
- Added symbol_first and html_entity
|
333
|
+
- Added allocation algorithm for fair(ish) splitting of money between parties
|
334
|
+
without losing pennies (thanks Tobias Luetke)
|
335
|
+
|
336
|
+
Bugfixes
|
337
|
+
--------
|
338
|
+
- Always store cents as an Integer (thanks Abhay Kumar)
|
339
|
+
- Fixed TypeError in rate exchange (thanks Christian Billen)
|
340
|
+
- Cleanup #parse (thanks Tom Lianza)
|
341
|
+
|
342
|
+
Money 3.5.4
|
343
|
+
===========
|
344
|
+
|
345
|
+
Features
|
346
|
+
--------
|
347
|
+
- Added Currency#decimal_places.
|
348
|
+
|
349
|
+
Bugfixes
|
350
|
+
--------
|
351
|
+
- Fixed error with Money#to_s error with negative amounts that are only cents.
|
352
|
+
|
353
|
+
Money 3.5.3
|
354
|
+
===========
|
355
|
+
|
356
|
+
Bugfixes
|
357
|
+
--------
|
358
|
+
- Fixed an error in #to_s when cents is negative
|
359
|
+
|
360
|
+
Money 3.5.2
|
361
|
+
===========
|
362
|
+
|
363
|
+
Bugfixes
|
364
|
+
--------
|
365
|
+
- Fixed an error in #to_s which appended extra 0s incorrectly
|
366
|
+
|
367
|
+
Money 3.5.1
|
368
|
+
===========
|
369
|
+
|
370
|
+
Bugfixes
|
371
|
+
--------
|
372
|
+
- Removed erroneous require.
|
373
|
+
|
374
|
+
Money 3.5.0
|
375
|
+
===========
|
376
|
+
|
377
|
+
Features
|
378
|
+
--------
|
379
|
+
- Updated to RSpec2.
|
380
|
+
- Use i18n to lookup separator and delimiter signs.
|
381
|
+
- Removed all deprecated methods up to v3.5.0, including the following:
|
382
|
+
- Using Money#format with params instead of a Hash.
|
383
|
+
- Using a Hash with Money#new.
|
384
|
+
- Using Bank#exchange, use Bank#exchange_with instead.
|
385
|
+
|
386
|
+
Bugfixes
|
387
|
+
--------
|
388
|
+
- Updated Money#to_s to respect :separator and :subunit_to_unit.
|
389
|
+
- Fixed Money#format for :subunit_to_unit != 100.
|
390
|
+
([#issue/37](http://github.com/RubyMoney/money/issue/37))
|
391
|
+
- Fixed String#to_money for :subunit_to_unit != 100.
|
392
|
+
([#issue/36](http://github.com/RubyMoney/money/issue/36))
|
393
|
+
- Removed duplicate currencies.
|
394
|
+
([#issue/38](http://github.com/RubyMoney/money/issue/38))
|
395
|
+
- Fixed issue related to JRuby returning 2 for Math.log10(1000).floor instead
|
396
|
+
of correctly returning 3.
|
397
|
+
|
398
|
+
Money 3.1.5
|
399
|
+
===========
|
400
|
+
|
401
|
+
Features
|
402
|
+
--------
|
403
|
+
- Added support for creating objects with the main monetary unit instead of
|
404
|
+
cents.
|
405
|
+
([#issue/25](http://github.com/RubyMoney/money/issues/25))
|
406
|
+
- Deprecated `Money#format` with separate params instead of Hash. Deprecation
|
407
|
+
target set to Money 3.5.0.
|
408
|
+
([#issue/31](http://github.com/RubyMoney/money/issues/31))
|
409
|
+
- Deprecated `Money#new(0, :currency => "EUR")` in favor of
|
410
|
+
`Money#new(0, "EUR")`. Deprecation target set to Money 3.5.0.
|
411
|
+
([#issue/31](http://github.com/RubyMoney/money/issues/31))
|
412
|
+
- Throw ArgumentError when trying to multiply two Money objects together.
|
413
|
+
([#issue/29](http://github.com/RubyMoney/money/issues/29))
|
414
|
+
- Update Money#parse to use :subunit_to_unit
|
415
|
+
([#issue/30](http://github.com/RubyMoney/money/issues/30))
|
416
|
+
|
417
|
+
Bugfixes
|
418
|
+
--------
|
419
|
+
- Downgraded required_rubygems_version to >= 1.3.6.
|
420
|
+
([#issue/26](http://github.com/RubyMoney/money/issues/26))
|
421
|
+
- Use BigDecimal when floating point calculations are needed.
|
422
|
+
- Ruby 1.9.2 compatibility enhancements.
|
423
|
+
|
424
|
+
Money 3.1.0
|
425
|
+
===========
|
426
|
+
|
427
|
+
Features
|
428
|
+
--------
|
429
|
+
- Implemented `Money::Bank::Base`.
|
430
|
+
([#issue/14](http://github.com/RubyMoney/money/issues/14))
|
431
|
+
- Added `Money::Bank::Base#exchange_with`.
|
432
|
+
- Deprecated `Money::Bank::Base#exchange`. Deprecation target set to Money
|
433
|
+
3.2.0.
|
434
|
+
- Implented `Money::Bank::VariableExchange`
|
435
|
+
- Deprecated `Money::VariableExchangeBank`. Deprecation target set to Money
|
436
|
+
3.2.0.
|
437
|
+
- Deprecate `Money::SYMBOLS`, `Money::SEPARATORS` and `Money::DELIMITERS`.
|
438
|
+
Deprecation target set to Money 3.2.0.
|
439
|
+
([#issue/16](http://github.com/RubyMoney/money/issues/16))
|
440
|
+
- Implemented `#has` for `Money` and `Money::Currency`.
|
441
|
+
- Refactored test suite to conform to RSpec conventions.
|
442
|
+
- Moved project from [FooBarWidget](http://github.com/FooBarWidget) to
|
443
|
+
[RubyMoney](http://github.com/RubyMoney)
|
444
|
+
- Added Simone Carletti to list of authors.
|
445
|
+
- Moved `@rounding_method` from `Money::Bank::VariableExchange` to
|
446
|
+
`Money::Bank::Base`.
|
447
|
+
([#issue/18](http://github.com/RubyMoney/money/issues/18))
|
448
|
+
- Added `#setup` to `Money::Bank::Base`. Called from `#initialize`.
|
449
|
+
([#issue/19](http://github.com/RubyMoney/money/issues/19))
|
450
|
+
- Added [google_currency](http://github.com/RubyMoney/google_currency) to list
|
451
|
+
of Currency Exchange Implementations.
|
452
|
+
- Added `#export_rates` to `Money::Bank::VariableExchange`.
|
453
|
+
([#issue/21](http://github.com/RubyMoney/money/issues/21))
|
454
|
+
- Added `#import_rates` to `Money::Bank::VariableExchange`.
|
455
|
+
([#issue/21](http://github.com/RubyMoney/money/issues/21))
|
456
|
+
- Removed dependency on Jeweler.
|
457
|
+
- Replaced usage of hanna with yardoc.
|
458
|
+
- Rewrote/reformatted all documentation.
|
459
|
+
|
460
|
+
Bugfixes
|
461
|
+
--------
|
462
|
+
- Fixed incorrect URLs in documentation.
|
463
|
+
([#issue/17](http://github.com/RubyMoney/money/issues/17))
|
464
|
+
- Updated `:subunit_to_unit` for HKD from 10 to 100.
|
465
|
+
([#issue/20](http://github.com/RubyMoney/money/issues/20))
|
466
|
+
- Updated Ghanaian Cedi to use correct ISO Code, GHS.
|
467
|
+
([#issue/22](http://github.com/RubyMoney/money/issues/22))
|
468
|
+
- Make `default` rake task call `spec`.
|
469
|
+
([#issue/23](http://github.com/RubyMoney/money/issues/23))
|
470
|
+
|
471
|
+
Money 3.1.0.pre3
|
472
|
+
================
|
473
|
+
|
474
|
+
Features
|
475
|
+
--------
|
476
|
+
- Added [google_currency](http://github.com/RubyMoney/google_currency) to list
|
477
|
+
of Currency Exchange Implementations.
|
478
|
+
- Added `#export_rates` to `Money::Bank::VariableExchange`.
|
479
|
+
([#issue/21](http://github.com/RubyMoney/money/issues/21))
|
480
|
+
- Added `#import_rates` to `Money::Bank::VariableExchange`.
|
481
|
+
([#issue/21](http://github.com/RubyMoney/money/issues/21))
|
482
|
+
|
483
|
+
Bugfixes
|
484
|
+
--------
|
485
|
+
- Updated `:subunit_to_unit` for HKD from 10 to 100.
|
486
|
+
([#issue/20](http://github.com/RubyMoney/money/issues/20))
|
487
|
+
|
488
|
+
Money 3.1.0.pre2
|
489
|
+
================
|
490
|
+
|
491
|
+
Features
|
492
|
+
--------
|
493
|
+
- Moved `@rounding_method` from `Money::Bank::VariableExchange` to
|
494
|
+
`Money::Bank::Base`.
|
495
|
+
([#issue/18](http://github.com/RubyMoney/money/issues/18))
|
496
|
+
- Added `#setup` to `Money::Bank::Base`. Called from `#initialize`.
|
497
|
+
([#issue/19](http://github.com/RubyMoney/money/issues/19))
|
498
|
+
|
499
|
+
Bugfixes
|
500
|
+
--------
|
501
|
+
- Fixed incorrect URLs in documentation.
|
502
|
+
([#issue/17](http://github.com/RubyMoney/money/issues/17))
|
503
|
+
|
504
|
+
Money 3.1.0.pre1
|
505
|
+
================
|
506
|
+
|
507
|
+
Features
|
508
|
+
--------
|
509
|
+
- Implemented `Money::Bank::Base`.
|
510
|
+
([#issue/14](http://github.com/RubyMoney/money/issues/14))
|
511
|
+
- Added `Money::Bank::Base#exchange_with`.
|
512
|
+
- Deprecated `Money::Bank::Base#exchange`. Deprecation target set to Money
|
513
|
+
3.2.0.
|
514
|
+
- Implented `Money::Bank::VariableExchange`
|
515
|
+
- Deprecated `Money::VariableExchangeBank`. Deprecation target set to Money
|
516
|
+
3.2.0.
|
517
|
+
- Deprecate `Money::SYMBOLS`, `Money::SEPARATORS` and `Money::DELIMITERS`.
|
518
|
+
Deprecation target set to Money 3.2.0.
|
519
|
+
([#issue/16](http://github.com/RubyMoney/money/issues/16))
|
520
|
+
- Implemented `#has` for `Money` and `Money::Currency`.
|
521
|
+
- Refactored test suite to conform to RSpec conventions.
|
522
|
+
- Moved project from [FooBarWidget](http://github.com/FooBarWidget) to
|
523
|
+
[RubyMoney](http://github.com/RubyMoney)
|
524
|
+
- Added Simone Carletti to list of authors.
|
525
|
+
|
526
|
+
Bugfixes
|
527
|
+
--------
|
528
|
+
- Fixed rounding error in `Numeric#to_money`.
|
529
|
+
([#issue/15](http://github.com/RubyMoney/money/issues/15))
|
530
|
+
|
531
|
+
Money 3.0.5
|
532
|
+
===========
|
533
|
+
|
534
|
+
Features
|
535
|
+
--------
|
536
|
+
- Added `Money#abs`.
|
537
|
+
- Added ability to pass a block to `VariableExchangeBank#new` or `#exchange`,
|
538
|
+
specifying a custom truncation method
|
539
|
+
- Added optional `currency` argument to` Numeric#to_money`.
|
540
|
+
([#issue/11](http://github.com/RubyMoney/money/issues/11))
|
541
|
+
- Added optional `currency` argument to `String#to_money`.
|
542
|
+
([#issue/11](http://github.com/RubyMoney/money/issues/11))
|
543
|
+
- Use '¤' as the default currency symbol.
|
544
|
+
([#issue/10](http://github.com/RubyMoney/money/issues/10))
|
545
|
+
|
546
|
+
Bugfixes
|
547
|
+
--------
|
548
|
+
- Updated `Currency#subunit_to_unit` documentation (it's an integer not a
|
549
|
+
string).
|
550
|
+
- Fixed issue when exchanging currencies with different `:subunit_to_unit`
|
551
|
+
values.
|
552
|
+
- `Numeric#to_money` now respects `:subunit_to_unit`.
|
553
|
+
([#issue/12](http://github.com/RubyMoney/money/issues/12))
|
554
|
+
|
555
|
+
Money 3.0.4
|
556
|
+
===========
|
557
|
+
|
558
|
+
Features
|
559
|
+
--------
|
560
|
+
- Use `:subunit_to_unit` in `#to_s`, `#to_f` and `#format`.
|
561
|
+
- Deprecated `Money#SEPARATORS` and `Money#DELIMITERS`.
|
562
|
+
|
563
|
+
Bugfixes
|
564
|
+
--------
|
565
|
+
- Updated `#exchange` to avoid floating point rounding errors.
|
566
|
+
- Added `:separator` and `:delimiter` to `Currency`
|
567
|
+
- Updated the attributes of the Chilean Peso.
|
568
|
+
|
569
|
+
Money 3.0.3
|
570
|
+
===========
|
571
|
+
|
572
|
+
Features
|
573
|
+
--------
|
574
|
+
- Added `#currency_as_string` and `#currency_as_string=` for easier
|
575
|
+
integration with ActiveRecord/Rails
|
576
|
+
|
577
|
+
Money 3.0.2
|
578
|
+
===========
|
579
|
+
|
580
|
+
Features
|
581
|
+
--------
|
582
|
+
- Added `#div`, `#divmod`, `#modulo`, `#%` and `#remainder` to `Money`.
|
583
|
+
|
584
|
+
Money 3.0.1
|
585
|
+
===========
|
586
|
+
|
587
|
+
Features
|
588
|
+
--------
|
589
|
+
- Added `#eql?` to `Money`
|
590
|
+
- Updated `Numeric#to_money` to work with all children of `Numeric` (i.e.
|
591
|
+
`BigDecimal`, `Integer`, `Fixnum`, `Float`, etc)
|
592
|
+
|
593
|
+
Money 3.0.0
|
594
|
+
===========
|
595
|
+
|
596
|
+
Features
|
597
|
+
--------
|
598
|
+
- Version Bump due to compatibility changes with ActiveRecord. See
|
599
|
+
conversation
|
600
|
+
[here](http://github.com/RubyMoney/money/issues#issue/4/comment/224880)
|
601
|
+
for more information.
|
602
|
+
|
603
|
+
Money 2.3.0
|
604
|
+
===========
|
605
|
+
|
606
|
+
Features
|
607
|
+
--------
|
608
|
+
- Currency is now represented by a `Currency` Object instead of a `String`.
|
609
|
+
|
610
|
+
Money 2.2.0
|
611
|
+
===========
|
612
|
+
|
613
|
+
Features
|
614
|
+
--------
|
615
|
+
- Can now divide two Money objects by one another using `#/`.
|
616
|
+
- Can now convert a Money object to a float using `#to_f`.
|
617
|
+
- Users can now specify Separators and Delimiters when using `#format`.
|
618
|
+
- Support for Brazilian Real `Money.new(1_00, :BRL)`
|
619
|
+
- Migrated to Jeweler
|