eu_central_bank 1.2.0 → 1.3.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: 26db70b1738fe23d51ac5c5f8058d919c6d984a7
4
- data.tar.gz: 87e889b16430801678fe4c0068ab617dac4ca277
3
+ metadata.gz: cbbedf457cb6bfe27ebcab750a10b7c421fa6dc0
4
+ data.tar.gz: 1efc1e2652c6b46d712709d56ff94241c8eef871
5
5
  SHA512:
6
- metadata.gz: '09440257ef2ca6e4cc71b486f11d90fc7506c54807d91ebdc013969926c9db5fb5d66e49cc54e1e751bf05f3ae9e33cd3b4041be19153b43c82b1035fbb38e0d'
7
- data.tar.gz: cf74ece7b3bab97b1b4c673a150fe14590f920452c26f25c33aeb31272cf8affe366017c5dc6765a8754e7a814061b6e14778ae8277635537015c2050fe5c9f0
6
+ metadata.gz: 30de075118321b90fb3bbb1ebacf1f868f2cb58ce040206170850454b5bb3b9463ff9e93aa5fe162d23cf854844599c0d0856f42792523148c46697d177c46c9
7
+ data.tar.gz: 66649cfc85ca8a1b3e52274beea20c2cca160ae1489564da6eeed1c3a78b9baa3ef4849c4cd369480742400694aff3539b0360bed7a7e46a74977c1c1520119f
@@ -1,5 +1,11 @@
1
1
  # eu_central_bank changelog
2
2
 
3
+ ## 1.3.0 (Jun 12 2018)
4
+
5
+ * Add configurable rates store
6
+ * Add support for Icelandic Krona (ISK)
7
+ * Bump money dependency to 6.11
8
+
3
9
  ## 1.2.0 (Dec 29 2017)
4
10
 
5
11
  * Bump money dependency to 6.10.1
data/README.md CHANGED
@@ -47,7 +47,7 @@ Money.us_dollar(100).exchange_to("CAD") # Money.new(124, "CAD")
47
47
  eu_bank.exchange_with(Money.new(100, "CAD"), "USD") # Money.new(80, "USD")
48
48
  ```
49
49
 
50
- For performance reasons, you may prefer to read from a file instead. Furthermore, ECB publishes their rates daily. It makes sense to save the rates in a file to read from. It also adds an __update_at__ field so that you can manage the update.
50
+ For performance reasons, you may prefer to read from a file instead. Furthermore, ECB publishes their rates daily. It makes sense to save the rates in a file to read from. It also adds an `updated_at` field so that you can manage the update.
51
51
 
52
52
  ``` ruby
53
53
  # cached location
@@ -1,7 +1,7 @@
1
1
  require 'open-uri'
2
2
  require 'nokogiri'
3
3
  require 'money'
4
- require 'money/rates_store/eu_central_bank_historical_data_support'
4
+ require 'money/rates_store/store_with_historical_data_support'
5
5
 
6
6
  class InvalidCache < StandardError ; end
7
7
 
@@ -16,13 +16,12 @@ class EuCentralBank < Money::Bank::VariableExchange
16
16
 
17
17
  SERIALIZER_DATE_SEPARATOR = '_AT_'
18
18
 
19
- CURRENCIES = %w(USD JPY BGN CZK DKK GBP HUF ILS PLN RON SEK CHF NOK HRK RUB TRY AUD BRL CAD CNY HKD IDR INR KRW MXN MYR NZD PHP SGD THB ZAR).map(&:freeze).freeze
19
+ CURRENCIES = %w(USD JPY BGN CZK DKK GBP HUF ILS ISK PLN RON SEK CHF NOK HRK RUB TRY AUD BRL CAD CNY HKD IDR INR KRW MXN MYR NZD PHP SGD THB ZAR).map(&:freeze).freeze
20
20
  ECB_RATES_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'.freeze
21
21
  ECB_90_DAY_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml'.freeze
22
22
 
23
- def initialize(*)
23
+ def initialize(st = Money::RatesStore::StoreWithHistoricalDataSupport.new, &block)
24
24
  super
25
- @store.extend Money::RatesStore::EuCentralBankHistoricalDataSupport
26
25
  @currency_string = nil
27
26
  end
28
27
 
@@ -1,5 +1,5 @@
1
1
  module Money::RatesStore
2
- module EuCentralBankHistoricalDataSupport
2
+ class StoreWithHistoricalDataSupport < Money::RatesStore::Memory
3
3
  INDEX_DATE_SEPARATOR = '_AT_'.freeze
4
4
 
5
5
  def add_rate(currency_iso_from, currency_iso_to, rate, date = nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eu_central_bank
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.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: 2017-12-29 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 6.10.1
33
+ version: 6.11.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 6.10.1
40
+ version: 6.11.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -64,7 +64,7 @@ files:
64
64
  - LICENSE
65
65
  - README.md
66
66
  - lib/eu_central_bank.rb
67
- - lib/money/rates_store/eu_central_bank_historical_data_support.rb
67
+ - lib/money/rates_store/store_with_historical_data_support.rb
68
68
  homepage: https://github.com/RubyMoney/eu_central_bank
69
69
  licenses: []
70
70
  metadata: {}