money 5.1.0.beta1 → 5.1.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.
- data/CHANGELOG.md +22 -2
- data/config/currency.json +176 -19
- data/config/currency_bc.json +8 -0
- data/lib/money.rb +0 -1
- data/lib/money/currency.rb +6 -1
- data/lib/money/currency/heuristics.rb +149 -0
- data/lib/money/{currency_loader.rb → currency/loader.rb} +2 -2
- data/lib/money/money/parsing.rb +1 -1
- data/money.gemspec +1 -1
- data/spec/currency/heuristics_spec.rb +84 -0
- data/spec/money/formatting_spec.rb +4 -58
- data/spec/money/parsing_spec.rb +4 -2
- data/spec/spec_helper.rb +3 -0
- data/spec/support/default_currency_helper.rb +13 -0
- metadata +18 -15
@@ -0,0 +1,13 @@
|
|
1
|
+
module DefaultCurrencyHelper
|
2
|
+
|
3
|
+
def with_default_currency(iso_code)
|
4
|
+
original_default = Money.default_currency
|
5
|
+
begin
|
6
|
+
Money.default_currency = Money::Currency.new(iso_code)
|
7
|
+
yield
|
8
|
+
ensure
|
9
|
+
Money.default_currency = original_default
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: money
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.0
|
5
|
-
prerelease:
|
4
|
+
version: 5.1.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Tobias Luetke
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2012-10
|
16
|
+
date: 2012-11-10 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: i18n
|
@@ -86,27 +86,30 @@ executables: []
|
|
86
86
|
extensions: []
|
87
87
|
extra_rdoc_files: []
|
88
88
|
files:
|
89
|
-
- config/currency_bc.json
|
90
89
|
- config/currency.json
|
91
|
-
-
|
90
|
+
- config/currency_bc.json
|
91
|
+
- lib/money/bank/base.rb
|
92
|
+
- lib/money/bank/variable_exchange.rb
|
93
|
+
- lib/money/core_extensions.rb
|
94
|
+
- lib/money/currency/heuristics.rb
|
95
|
+
- lib/money/currency/loader.rb
|
96
|
+
- lib/money/currency.rb
|
92
97
|
- lib/money/money/arithmetic.rb
|
93
|
-
- lib/money/money/parsing.rb
|
94
98
|
- lib/money/money/formatting.rb
|
99
|
+
- lib/money/money/parsing.rb
|
95
100
|
- lib/money/money.rb
|
96
|
-
- lib/money/core_extensions.rb
|
97
|
-
- lib/money/currency.rb
|
98
|
-
- lib/money/bank/variable_exchange.rb
|
99
|
-
- lib/money/bank/base.rb
|
100
101
|
- lib/money.rb
|
102
|
+
- spec/bank/base_spec.rb
|
103
|
+
- spec/bank/variable_exchange_spec.rb
|
104
|
+
- spec/core_extensions_spec.rb
|
105
|
+
- spec/currency/heuristics_spec.rb
|
101
106
|
- spec/currency_spec.rb
|
102
|
-
- spec/money/parsing_spec.rb
|
103
|
-
- spec/money/formatting_spec.rb
|
104
107
|
- spec/money/arithmetic_spec.rb
|
108
|
+
- spec/money/formatting_spec.rb
|
109
|
+
- spec/money/parsing_spec.rb
|
105
110
|
- spec/money_spec.rb
|
106
|
-
- spec/core_extensions_spec.rb
|
107
111
|
- spec/spec_helper.rb
|
108
|
-
- spec/
|
109
|
-
- spec/bank/base_spec.rb
|
112
|
+
- spec/support/default_currency_helper.rb
|
110
113
|
- CHANGELOG.md
|
111
114
|
- LICENSE
|
112
115
|
- README.md
|