money-open-exchange-rates 0.1.7 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +19 -15
- data/lib/money/bank/open_exchange_rates_bank.rb +2 -17
- data/test/open_exchange_rates_bank_test.rb +61 -128
- data/test/test_helper.rb +1 -2
- metadata +57 -26
- checksums.yaml +0 -7
data/README.markdown
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# Money Open Exchange Rates
|
2
2
|
|
3
3
|
A gem that calculates the exchange rate using published rates from
|
4
|
-
[open-exchange-rates](
|
4
|
+
[open-exchange-rates](https://openexchangerates.org/)
|
5
5
|
|
6
6
|
## Usage
|
7
7
|
|
8
|
-
|
8
|
+
~~~ ruby
|
9
9
|
require 'money/bank/open_exchange_rates_bank'
|
10
10
|
moe = Money::Bank::OpenExchangeRatesBank.new
|
11
11
|
moe.cache = 'path/to/file/cache'
|
@@ -18,12 +18,12 @@ moe.update_rates
|
|
18
18
|
moe.ttl_in_seconds = 86400
|
19
19
|
|
20
20
|
Money.default_bank = moe
|
21
|
-
|
21
|
+
~~~
|
22
22
|
|
23
23
|
You can also provide a Proc as a cache to provide your own caching mechanism
|
24
24
|
perhaps with Redis or just a thread safe `Hash` (global). For example:
|
25
25
|
|
26
|
-
|
26
|
+
~~~ ruby
|
27
27
|
moe.cache = Proc.new do |v|
|
28
28
|
key = 'money:exchange_rates'
|
29
29
|
if v
|
@@ -32,17 +32,17 @@ moe.cache = Proc.new do |v|
|
|
32
32
|
Thread.current[key]
|
33
33
|
end
|
34
34
|
end
|
35
|
-
|
35
|
+
~~~
|
36
36
|
|
37
37
|
## Tests
|
38
38
|
|
39
39
|
As of the end of August 2012 all requests to the Open Exchange Rates API must
|
40
|
-
have a valid app_id. You can place your own key on a file
|
41
|
-
then run:
|
40
|
+
have a valid app_id. You can place your own key on a file or environment
|
41
|
+
variable named TEST_APP_ID and then run:
|
42
42
|
|
43
|
-
|
43
|
+
~~~
|
44
44
|
bundle exec rake
|
45
|
-
|
45
|
+
~~~
|
46
46
|
|
47
47
|
## Refs
|
48
48
|
|
@@ -53,13 +53,17 @@ bundle exec rake
|
|
53
53
|
|
54
54
|
## Contributors
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
56
|
+
Wayne See (8)
|
57
|
+
Kevin Ball (3)
|
58
|
+
Paul Robinson (2)
|
59
|
+
Michael Morris (2)
|
60
|
+
Dmitry Dedov (2)
|
61
|
+
chatgris (2)
|
62
|
+
Sam Lown (1)
|
63
|
+
Fabio Cantoni (1)
|
61
64
|
|
62
65
|
## License
|
66
|
+
|
63
67
|
The MIT License
|
64
68
|
|
65
|
-
Copyright ©
|
69
|
+
Copyright © 2014 Laurent Arnoud <laurent@spkdev.net>
|
@@ -40,24 +40,9 @@ class Money
|
|
40
40
|
raise InvalidCache
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
44
|
-
exchange_with(Money.new(cents, from_currency), to_currency)
|
45
|
-
end
|
46
|
-
|
47
|
-
def exchange_with(from, to_currency)
|
48
|
-
return from if same_currency?(from.currency, to_currency)
|
49
|
-
rate = get_rate(from.currency, to_currency)
|
50
|
-
Money.new(((Money::Currency.wrap(to_currency).subunit_to_unit.to_f / from.currency.subunit_to_unit.to_f) * from.cents * rate).round, to_currency)
|
51
|
-
end
|
52
|
-
|
53
|
-
def get_rate(from_currency, to_currency)
|
43
|
+
def get_rate(from_currency, to_currency, opts = {})
|
54
44
|
expire_rates
|
55
|
-
super
|
56
|
-
from_base_rate = super("USD", from_currency)
|
57
|
-
to_base_rate = super("USD", to_currency)
|
58
|
-
raise(Money::Bank::UnknownRateFormat, "No conversion rate known for '#{from_currency}' -> '#{to_currency}'") if from_base_rate.nil? || to_base_rate.nil?
|
59
|
-
to_base_rate.to_f / from_base_rate.to_f
|
60
|
-
end
|
45
|
+
super
|
61
46
|
end
|
62
47
|
|
63
48
|
def expire_rates
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper'))
|
4
4
|
|
5
5
|
describe Money::Bank::OpenExchangeRatesBank do
|
6
|
+
subject { Money::Bank::OpenExchangeRatesBank.new }
|
6
7
|
|
7
8
|
before do
|
8
9
|
@cache_path = File.expand_path(File.join(File.dirname(__FILE__), 'latest.json'))
|
@@ -10,62 +11,38 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
10
11
|
|
11
12
|
describe 'exchange' do
|
12
13
|
before do
|
13
|
-
|
14
|
-
@bank.app_id = TEST_APP_ID
|
14
|
+
subject.app_id = TEST_APP_ID
|
15
15
|
@temp_cache_path = File.expand_path(File.join(File.dirname(__FILE__), 'tmp.json'))
|
16
|
-
|
16
|
+
subject.cache = @temp_cache_path
|
17
17
|
stub(OpenURI::OpenRead).open(Money::Bank::OpenExchangeRatesBank::OER_URL) { File.read @cache_path }
|
18
|
-
|
18
|
+
subject.save_rates
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should be able to exchange a money to its own currency even without rates" do
|
22
22
|
money = Money.new(0, "USD")
|
23
|
-
|
23
|
+
subject.exchange_with(money, "USD").must_equal money
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should raise if it can't find an exchange rate" do
|
27
27
|
money = Money.new(0, "USD")
|
28
|
-
|
28
|
+
proc { subject.exchange_with(money, "AUD") }.must_raise Money::Bank::UnknownRate
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
describe 'update_rates' do
|
33
33
|
before do
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
@bank.update_rates
|
34
|
+
subject.app_id = TEST_APP_ID
|
35
|
+
subject.cache = @cache_path
|
36
|
+
subject.update_rates
|
38
37
|
end
|
39
38
|
|
40
39
|
it "should update itself with exchange rates from OpenExchangeRates" do
|
41
|
-
|
40
|
+
subject.oer_rates.keys.each do |currency|
|
42
41
|
next unless Money::Currency.find(currency)
|
43
|
-
|
42
|
+
subject.get_rate("USD", currency).must_be :>, 0
|
44
43
|
end
|
45
44
|
end
|
46
45
|
|
47
|
-
it "should return the correct oer rates using oer" do
|
48
|
-
@bank.oer_rates.keys.each do |currency|
|
49
|
-
next unless Money::Currency.find(currency)
|
50
|
-
subunit = Money::Currency.wrap(currency).subunit_to_unit
|
51
|
-
@bank.exchange(100, "USD", currency).cents.
|
52
|
-
must_equal((@bank.oer_rates[currency].to_f * subunit).round)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
it "should return the correct oer rates using exchange_with" do
|
57
|
-
@bank.oer_rates.keys.each do |currency|
|
58
|
-
next unless Money::Currency.find(currency)
|
59
|
-
subunit = Money::Currency.wrap(currency).subunit_to_unit
|
60
|
-
@bank.exchange_with(Money.new(100, "USD"), currency).cents.
|
61
|
-
must_equal((@bank.oer_rates[currency].to_f * subunit).round)
|
62
|
-
|
63
|
-
@bank.exchange_with(1.to_money("USD"), currency).cents.
|
64
|
-
must_equal((@bank.oer_rates[currency].to_f * subunit).round)
|
65
|
-
end
|
66
|
-
@bank.exchange_with(5000.to_money('JPY'), 'USD').cents.must_equal 6441
|
67
|
-
end
|
68
|
-
|
69
46
|
it "should not return 0 with integer rate" do
|
70
47
|
wtf = {
|
71
48
|
:priority => 1,
|
@@ -78,8 +55,9 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
78
55
|
:delimiter => ","
|
79
56
|
}
|
80
57
|
Money::Currency.register(wtf)
|
81
|
-
|
82
|
-
|
58
|
+
subject.add_rate("USD", "WTF", 2)
|
59
|
+
subject.add_rate("WTF", "USD", 2)
|
60
|
+
subject.exchange_with(5000.to_money('WTF'), 'USD').cents.wont_equal 0
|
83
61
|
end
|
84
62
|
|
85
63
|
# in response to #4
|
@@ -95,23 +73,23 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
95
73
|
:delimiter => ","
|
96
74
|
}
|
97
75
|
Money::Currency.register(btc)
|
98
|
-
|
99
|
-
|
100
|
-
|
76
|
+
rate = 13.7603
|
77
|
+
subject.add_rate("USD", "BTC", 1 / 13.7603)
|
78
|
+
subject.add_rate("BTC", "USD", rate)
|
79
|
+
subject.exchange_with(100.to_money("BTC"), 'USD').cents.must_equal 137603
|
101
80
|
end
|
102
81
|
end
|
103
82
|
|
104
83
|
describe 'App ID' do
|
105
84
|
|
106
85
|
before do
|
107
|
-
@bank = Money::Bank::OpenExchangeRatesBank.new
|
108
86
|
@temp_cache_path = File.expand_path(File.join(File.dirname(__FILE__), 'tmp.json'))
|
109
|
-
|
87
|
+
subject.cache = @temp_cache_path
|
110
88
|
stub(OpenURI::OpenRead).open(Money::Bank::OpenExchangeRatesBank::OER_URL) { File.read @cache_path }
|
111
89
|
end
|
112
90
|
|
113
91
|
it 'should raise an error if no App ID is set' do
|
114
|
-
proc {
|
92
|
+
proc { subject.save_rates }.must_raise Money::Bank::NoAppId
|
115
93
|
end
|
116
94
|
|
117
95
|
#TODO: As App IDs are compulsory soon, need to add more tests handle
|
@@ -121,84 +99,80 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
121
99
|
|
122
100
|
describe 'no cache' do
|
123
101
|
before do
|
124
|
-
|
125
|
-
|
126
|
-
@bank.app_id = TEST_APP_ID
|
102
|
+
subject.cache = nil
|
103
|
+
subject.app_id = TEST_APP_ID
|
127
104
|
end
|
128
105
|
|
129
106
|
it 'should get from url' do
|
130
107
|
stub(OpenURI::OpenRead).open(Money::Bank::OpenExchangeRatesBank::OER_URL) { File.read @cache_path }
|
131
|
-
|
132
|
-
|
108
|
+
subject.update_rates
|
109
|
+
subject.oer_rates.wont_be_empty
|
133
110
|
end
|
134
111
|
|
135
112
|
it 'should raise an error if invalid path is given to save_rates' do
|
136
|
-
proc {
|
113
|
+
proc { subject.save_rates }.must_raise Money::Bank::InvalidCache
|
137
114
|
end
|
138
115
|
end
|
139
116
|
|
140
117
|
describe 'no valid file for cache' do
|
141
118
|
before do
|
142
|
-
|
143
|
-
|
144
|
-
@bank.app_id = TEST_APP_ID
|
119
|
+
subject.cache = "space_dir#{rand(999999999)}/out_space_file.json"
|
120
|
+
subject.app_id = TEST_APP_ID
|
145
121
|
end
|
146
122
|
|
147
123
|
it 'should get from url' do
|
148
124
|
stub(OpenURI::OpenRead).open(Money::Bank::OpenExchangeRatesBank::OER_URL) { File.read @cache_path }
|
149
|
-
|
150
|
-
|
125
|
+
subject.update_rates
|
126
|
+
subject.oer_rates.wont_be_empty
|
151
127
|
end
|
152
128
|
|
153
129
|
it 'should raise an error if invalid path is given to save_rates' do
|
154
|
-
proc {
|
130
|
+
proc { subject.save_rates }.must_raise Money::Bank::InvalidCache
|
155
131
|
end
|
156
132
|
end
|
157
133
|
|
158
134
|
describe 'using proc for cache' do
|
159
135
|
before :each do
|
160
136
|
$global_rates = nil
|
161
|
-
|
162
|
-
@bank.cache = Proc.new {|v|
|
137
|
+
subject.cache = Proc.new {|v|
|
163
138
|
if v
|
164
139
|
$global_rates = v
|
165
140
|
else
|
166
141
|
$global_rates
|
167
142
|
end
|
168
143
|
}
|
169
|
-
|
144
|
+
subject.app_id = TEST_APP_ID
|
170
145
|
end
|
171
146
|
|
172
147
|
it 'should get from url normally' do
|
173
|
-
stub(
|
174
|
-
|
175
|
-
|
148
|
+
stub(subject).source_url() { @cache_path }
|
149
|
+
subject.update_rates
|
150
|
+
subject.oer_rates.wont_be_empty
|
176
151
|
end
|
177
152
|
|
178
153
|
it 'should save from url and get from cache' do
|
179
|
-
stub(
|
180
|
-
|
154
|
+
stub(subject).source_url { @cache_path }
|
155
|
+
subject.save_rates
|
181
156
|
$global_rates.wont_be_empty
|
182
|
-
dont_allow(
|
183
|
-
|
184
|
-
|
157
|
+
dont_allow(subject).source_url
|
158
|
+
subject.update_rates
|
159
|
+
subject.oer_rates.wont_be_empty
|
185
160
|
end
|
186
161
|
|
187
162
|
end
|
188
163
|
|
189
164
|
describe 'save rates' do
|
190
165
|
before do
|
191
|
-
|
192
|
-
@bank.app_id = TEST_APP_ID
|
166
|
+
subject.app_id = TEST_APP_ID
|
193
167
|
@temp_cache_path = File.expand_path(File.join(File.dirname(__FILE__), 'tmp.json'))
|
194
|
-
|
168
|
+
subject.cache = @temp_cache_path
|
195
169
|
stub(OpenURI::OpenRead).open(Money::Bank::OpenExchangeRatesBank::OER_URL) { File.read @cache_path }
|
196
|
-
|
170
|
+
subject.save_rates
|
197
171
|
end
|
198
172
|
|
199
173
|
it 'should allow update after save' do
|
200
174
|
begin
|
201
|
-
|
175
|
+
subject.update_rates
|
202
176
|
rescue
|
203
177
|
assert false, "Should allow updating after saving"
|
204
178
|
end
|
@@ -206,22 +180,22 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
206
180
|
|
207
181
|
it "should not break an existing file if save fails to read" do
|
208
182
|
initial_size = File.read(@temp_cache_path).size
|
209
|
-
stub(
|
210
|
-
|
183
|
+
stub(subject).read_from_url {""}
|
184
|
+
subject.save_rates
|
211
185
|
File.open(@temp_cache_path).read.size.must_equal initial_size
|
212
186
|
end
|
213
187
|
|
214
188
|
it "should not break an existing file if save returns json without rates" do
|
215
189
|
initial_size = File.read(@temp_cache_path).size
|
216
|
-
stub(
|
217
|
-
|
190
|
+
stub(subject).read_from_url { %Q({"error": "An error"}) }
|
191
|
+
subject.save_rates
|
218
192
|
File.open(@temp_cache_path).read.size.must_equal initial_size
|
219
193
|
end
|
220
194
|
|
221
195
|
it "should not break an existing file if save returns a invalid json" do
|
222
196
|
initial_size = File.read(@temp_cache_path).size
|
223
|
-
stub(
|
224
|
-
|
197
|
+
stub(subject).read_from_url { %Q({invalid_json: "An error"}) }
|
198
|
+
subject.save_rates
|
225
199
|
File.open(@temp_cache_path).read.size.must_equal initial_size
|
226
200
|
end
|
227
201
|
|
@@ -230,55 +204,14 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
230
204
|
end
|
231
205
|
end
|
232
206
|
|
233
|
-
describe 'get rate' do
|
234
|
-
subject { Money::Bank::OpenExchangeRatesBank.new }
|
235
|
-
LVL_TO_LTL = 5
|
236
|
-
USD_TO_RUB = 50
|
237
|
-
USD_TO_EUR = 1.3
|
238
|
-
|
239
|
-
before do
|
240
|
-
# some kind of stubbing base class
|
241
|
-
Money::Bank::VariableExchange.class_eval do
|
242
|
-
def get_rate(from, to)
|
243
|
-
if from == 'LVL' && to == 'LTL'
|
244
|
-
LVL_TO_LTL
|
245
|
-
elsif from == 'USD' && to == 'RUB'
|
246
|
-
USD_TO_RUB
|
247
|
-
elsif from == 'USD' && to == 'EUR'
|
248
|
-
USD_TO_EUR
|
249
|
-
else
|
250
|
-
nil
|
251
|
-
end
|
252
|
-
end
|
253
|
-
end
|
254
|
-
end
|
255
|
-
|
256
|
-
it 'returns rate if Money::Bank::VariableExchange#get_rate returns rate' do
|
257
|
-
subject.get_rate('LVL','LTL').must_equal LVL_TO_LTL
|
258
|
-
end
|
259
|
-
|
260
|
-
describe 'calculate cross rate using "USD" rate value if no data was returned by Money::Bank::VariableExchange#get_rate' do
|
261
|
-
|
262
|
-
it 'returns cross rate if "USD" rates for provided currencies exist' do
|
263
|
-
eur_to_rub_cross_rate = USD_TO_RUB / USD_TO_EUR
|
264
|
-
subject.get_rate('EUR', 'RUB').must_equal eur_to_rub_cross_rate
|
265
|
-
end
|
266
|
-
|
267
|
-
it 'raises Money::Bank::UnknownRateFormat if no cross rates found' do
|
268
|
-
->{ subject.get_rate('ZAR', 'ZMK') }.must_raise Money::Bank::UnknownRateFormat
|
269
|
-
end
|
270
|
-
end
|
271
|
-
end
|
272
|
-
|
273
207
|
describe '#expire_rates' do
|
274
208
|
before do
|
275
|
-
|
276
|
-
|
277
|
-
@bank.ttl_in_seconds = 1000
|
209
|
+
subject.app_id = TEST_APP_ID
|
210
|
+
subject.ttl_in_seconds = 1000
|
278
211
|
@usd_eur_rate = 0.655
|
279
|
-
|
212
|
+
subject.add_rate('USD', 'EUR', @usd_eur_rate)
|
280
213
|
@temp_cache_path = File.expand_path(File.join(File.dirname(__FILE__), 'tmp.json'))
|
281
|
-
|
214
|
+
subject.cache = @temp_cache_path
|
282
215
|
stub(OpenURI::OpenRead).open(Money::Bank::OpenExchangeRatesBank::OER_URL) { File.read @cache_path }
|
283
216
|
end
|
284
217
|
|
@@ -293,23 +226,23 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
293
226
|
end
|
294
227
|
|
295
228
|
it 'should update the rates' do
|
296
|
-
|
297
|
-
|
229
|
+
subject.update_rates
|
230
|
+
subject.get_rate('USD', 'EUR').wont_equal @usd_eur_rate
|
298
231
|
end
|
299
232
|
|
300
233
|
it 'updates the next expiration time' do
|
301
234
|
exp_time = Time.now + 1000
|
302
235
|
|
303
|
-
|
304
|
-
|
236
|
+
subject.expire_rates
|
237
|
+
subject.rates_expiration.must_equal exp_time
|
305
238
|
end
|
306
239
|
end
|
307
240
|
|
308
241
|
describe 'when the ttl has not expired' do
|
309
242
|
it 'not should update the rates' do
|
310
|
-
exp_time =
|
311
|
-
|
312
|
-
|
243
|
+
exp_time = subject.rates_expiration
|
244
|
+
subject.expire_rates
|
245
|
+
subject.rates_expiration.must_equal exp_time
|
313
246
|
end
|
314
247
|
end
|
315
248
|
end
|
data/test/test_helper.rb
CHANGED
@@ -2,10 +2,9 @@
|
|
2
2
|
require 'minitest/autorun'
|
3
3
|
require 'rr'
|
4
4
|
require 'money/bank/open_exchange_rates_bank'
|
5
|
-
require 'monetize
|
5
|
+
require 'monetize'
|
6
6
|
require 'timecop'
|
7
7
|
require 'pry'
|
8
|
-
Money.silence_core_extensions_deprecations = true
|
9
8
|
|
10
9
|
TEST_APP_ID_PATH = File.join(File.dirname(__FILE__), '..', 'TEST_APP_ID')
|
11
10
|
TEST_APP_ID = ENV['TEST_APP_ID'] || File.read(TEST_APP_ID_PATH)
|
metadata
CHANGED
@@ -1,112 +1,142 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: money-open-exchange-rates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Laurent Arnoud
|
8
|
-
- Sam Lown
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: money
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
17
18
|
requirements:
|
18
|
-
- -
|
19
|
+
- - ~>
|
19
20
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
21
|
+
version: 6.2.1
|
21
22
|
type: :runtime
|
22
23
|
prerelease: false
|
23
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
|
-
- -
|
27
|
+
- - ~>
|
26
28
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
29
|
+
version: 6.2.1
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: monetize
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.4.1
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.4.1
|
28
46
|
- !ruby/object:Gem::Dependency
|
29
47
|
name: minitest
|
30
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
31
50
|
requirements:
|
32
|
-
- -
|
51
|
+
- - ! '>='
|
33
52
|
- !ruby/object:Gem::Version
|
34
53
|
version: '2.0'
|
35
54
|
type: :development
|
36
55
|
prerelease: false
|
37
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
38
58
|
requirements:
|
39
|
-
- -
|
59
|
+
- - ! '>='
|
40
60
|
- !ruby/object:Gem::Version
|
41
61
|
version: '2.0'
|
42
62
|
- !ruby/object:Gem::Dependency
|
43
63
|
name: pry
|
44
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
45
66
|
requirements:
|
46
|
-
- -
|
67
|
+
- - ! '>='
|
47
68
|
- !ruby/object:Gem::Version
|
48
69
|
version: '0'
|
49
70
|
type: :development
|
50
71
|
prerelease: false
|
51
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
52
74
|
requirements:
|
53
|
-
- -
|
75
|
+
- - ! '>='
|
54
76
|
- !ruby/object:Gem::Version
|
55
77
|
version: '0'
|
56
78
|
- !ruby/object:Gem::Dependency
|
57
79
|
name: rr
|
58
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
59
82
|
requirements:
|
60
|
-
- -
|
83
|
+
- - ! '>='
|
61
84
|
- !ruby/object:Gem::Version
|
62
85
|
version: 1.0.4
|
63
86
|
type: :development
|
64
87
|
prerelease: false
|
65
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
66
90
|
requirements:
|
67
|
-
- -
|
91
|
+
- - ! '>='
|
68
92
|
- !ruby/object:Gem::Version
|
69
93
|
version: 1.0.4
|
70
94
|
- !ruby/object:Gem::Dependency
|
71
95
|
name: rake
|
72
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
73
98
|
requirements:
|
74
|
-
- -
|
99
|
+
- - ! '>='
|
75
100
|
- !ruby/object:Gem::Version
|
76
101
|
version: '0'
|
77
102
|
type: :development
|
78
103
|
prerelease: false
|
79
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
80
106
|
requirements:
|
81
|
-
- -
|
107
|
+
- - ! '>='
|
82
108
|
- !ruby/object:Gem::Version
|
83
109
|
version: '0'
|
84
110
|
- !ruby/object:Gem::Dependency
|
85
111
|
name: timecop
|
86
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
87
114
|
requirements:
|
88
|
-
- -
|
115
|
+
- - ! '>='
|
89
116
|
- !ruby/object:Gem::Version
|
90
117
|
version: '0'
|
91
118
|
type: :development
|
92
119
|
prerelease: false
|
93
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
94
122
|
requirements:
|
95
|
-
- -
|
123
|
+
- - ! '>='
|
96
124
|
- !ruby/object:Gem::Version
|
97
125
|
version: '0'
|
98
126
|
- !ruby/object:Gem::Dependency
|
99
127
|
name: json
|
100
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
101
130
|
requirements:
|
102
|
-
- -
|
131
|
+
- - ! '>='
|
103
132
|
- !ruby/object:Gem::Version
|
104
133
|
version: '1.7'
|
105
134
|
type: :runtime
|
106
135
|
prerelease: false
|
107
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
108
138
|
requirements:
|
109
|
-
- -
|
139
|
+
- - ! '>='
|
110
140
|
- !ruby/object:Gem::Version
|
111
141
|
version: '1.7'
|
112
142
|
description: A gem that calculates the exchange rate using published rates from open-exchange-rates.
|
@@ -117,36 +147,37 @@ extensions: []
|
|
117
147
|
extra_rdoc_files:
|
118
148
|
- README.markdown
|
119
149
|
files:
|
120
|
-
- Gemfile
|
121
150
|
- LICENSE
|
122
151
|
- README.markdown
|
152
|
+
- Gemfile
|
123
153
|
- lib/money/bank/open_exchange_rates_bank.rb
|
124
|
-
- test/latest.json
|
125
154
|
- test/open_exchange_rates_bank_test.rb
|
155
|
+
- test/latest.json
|
126
156
|
- test/test_helper.rb
|
127
157
|
homepage: http://github.com/spk/money-open-exchange-rates
|
128
158
|
licenses:
|
129
159
|
- MIT
|
130
|
-
metadata: {}
|
131
160
|
post_install_message:
|
132
161
|
rdoc_options: []
|
133
162
|
require_paths:
|
134
163
|
- lib
|
135
164
|
required_ruby_version: !ruby/object:Gem::Requirement
|
165
|
+
none: false
|
136
166
|
requirements:
|
137
|
-
- -
|
167
|
+
- - ! '>='
|
138
168
|
- !ruby/object:Gem::Version
|
139
169
|
version: 1.9.2
|
140
170
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
|
+
none: false
|
141
172
|
requirements:
|
142
|
-
- -
|
173
|
+
- - ! '>='
|
143
174
|
- !ruby/object:Gem::Version
|
144
175
|
version: '0'
|
145
176
|
requirements: []
|
146
177
|
rubyforge_project:
|
147
|
-
rubygems_version:
|
178
|
+
rubygems_version: 1.8.23
|
148
179
|
signing_key:
|
149
|
-
specification_version:
|
180
|
+
specification_version: 3
|
150
181
|
summary: A gem that calculates the exchange rate using published rates from open-exchange-rates.
|
151
182
|
test_files:
|
152
183
|
- test/open_exchange_rates_bank_test.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 47727fe9bad23633da19274d859b19a6178fac03
|
4
|
-
data.tar.gz: 2ca0a29fd3ac60268bfe16f6bc5ce5245602b5fa
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 1858044994a092557f0f9db8107ed5e6b537efe1d6d95ee8654f0df7734c83805ea906bedda731ce2729a1dbf6b7b3c5d9846292581d2671da1db6f3a8a52a68
|
7
|
-
data.tar.gz: 893d31e26b8cf61e5242df6253486f7205bd5ba4af50f04e88ad1bec88243747d9705a95fb1bb3df7aab68d1990835816363d72b78daecf67467c19aca751852
|