money-open-exchange-rates 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +7 -0
- data/README.md +6 -0
- data/lib/money/bank/open_exchange_rates_bank.rb +2 -2
- data/lib/open_exchange_rates_bank/version.rb +1 -1
- data/test/open_exchange_rates_bank_test.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73bc7cbbe69a86d58f6376c4670c53996aa6675d
|
4
|
+
data.tar.gz: 79425bdbc492a05b9070791f919389a5e2f347b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d8f3a886a0dfefc7f1172ebd72c81f5353cd96cfaae5477ba6d1c0e16ec2b2c4f546da7bb9cae06a597b3b8919d30eb0b39a0ac3b065fc0e9ca52c6a15bd3a
|
7
|
+
data.tar.gz: 1cf0505b5695351d429deff4e42fe762295a259c1d99cd908bfde791bda134867ccf9a662aff0be576d0e9ffd481a32e2d5a9ff2900ebb0884d77913e2315c72
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -45,6 +45,12 @@ moe.secure_connection = true
|
|
45
45
|
# set historical date of the rate
|
46
46
|
# see https://openexchangerates.org/documentation#historical-data
|
47
47
|
moe.date = '2015-01-01'
|
48
|
+
# (optional)
|
49
|
+
# Set the base currency for all rates. By default, USD is used.
|
50
|
+
# OpenExchangeRates only allows USD as base currency
|
51
|
+
# for the free plan users.
|
52
|
+
moe.source = 'USD'
|
53
|
+
|
48
54
|
# Store in cache
|
49
55
|
moe.save_rates
|
50
56
|
|
@@ -19,10 +19,10 @@ class Money
|
|
19
19
|
# OpenExchangeRatesBank base class
|
20
20
|
class OpenExchangeRatesBank < Money::Bank::VariableExchange
|
21
21
|
VERSION = ::OpenExchangeRatesBank::VERSION
|
22
|
-
BASE_URL = 'http://openexchangerates.org/api'.freeze
|
22
|
+
BASE_URL = 'http://openexchangerates.org/api/'.freeze
|
23
23
|
# OpenExchangeRates urls
|
24
24
|
OER_URL = URI.join(BASE_URL, 'latest.json')
|
25
|
-
OER_HISTORICAL_URL = URI.join(BASE_URL, '
|
25
|
+
OER_HISTORICAL_URL = URI.join(BASE_URL, 'historical/')
|
26
26
|
# OpenExchangeRates secure url
|
27
27
|
SECURE_OER_URL = OER_URL.clone
|
28
28
|
SECURE_OER_URL.scheme = 'https'
|
@@ -176,6 +176,7 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
176
176
|
subject.secure_connection = nil
|
177
177
|
subject.source_url.must_equal historical_url
|
178
178
|
subject.source_url.must_include 'http://'
|
179
|
+
subject.source_url.must_include 'api'
|
179
180
|
subject.source_url.must_include 'historical'
|
180
181
|
end
|
181
182
|
|
@@ -183,6 +184,7 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
183
184
|
subject.secure_connection = false
|
184
185
|
subject.source_url.must_equal historical_url
|
185
186
|
subject.source_url.must_include 'http://'
|
187
|
+
subject.source_url.must_include 'api'
|
186
188
|
subject.source_url.must_include 'historical'
|
187
189
|
end
|
188
190
|
|
@@ -190,6 +192,7 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
190
192
|
subject.secure_connection = true
|
191
193
|
subject.source_url.must_equal historical_secure_url
|
192
194
|
subject.source_url.must_include 'https://'
|
195
|
+
subject.source_url.must_include 'api'
|
193
196
|
subject.source_url.must_include 'historical'
|
194
197
|
end
|
195
198
|
end
|
@@ -207,6 +210,7 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
207
210
|
subject.secure_connection = nil
|
208
211
|
subject.source_url.must_equal source_url
|
209
212
|
subject.source_url.must_include 'http://'
|
213
|
+
subject.source_url.must_include 'api'
|
210
214
|
subject.source_url.must_include 'latest'
|
211
215
|
end
|
212
216
|
|
@@ -214,6 +218,7 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
214
218
|
subject.secure_connection = false
|
215
219
|
subject.source_url.must_equal source_url
|
216
220
|
subject.source_url.must_include 'http://'
|
221
|
+
subject.source_url.must_include 'api'
|
217
222
|
subject.source_url.must_include 'latest'
|
218
223
|
end
|
219
224
|
|
@@ -221,6 +226,7 @@ describe Money::Bank::OpenExchangeRatesBank do
|
|
221
226
|
subject.secure_connection = true
|
222
227
|
subject.source_url.must_equal source_secure_url
|
223
228
|
subject.source_url.must_include 'https://'
|
229
|
+
subject.source_url.must_include 'api'
|
224
230
|
subject.source_url.must_include 'latest'
|
225
231
|
end
|
226
232
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: money-open-exchange-rates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurent Arnoud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: money
|