eu_central_bank 0.5.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +7 -0
- data/README.md +4 -4
- data/lib/eu_central_bank.rb +3 -4
- metadata +20 -27
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 739f04adc1c5623cc7b81bc647aedfda0bdd3d32
|
4
|
+
data.tar.gz: e1856709ab6f5705100d21dda36e52a4a8f3e29d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 367913b58f6e98eddd33adfd0b96887b2cbf794911b13c67289edfd2ccf3ce3f4de18f2716cc05fcb14d828cde3f64314097112c1d57d2c89312c8129a2d2eab
|
7
|
+
data.tar.gz: 7c80e5bc1125fe13c2ca57146a780e73c6610df90430973307503bc44e852193a5b44a5655f1850dd30a396b91976ed2ada68753e66bfe0aeb696b2a4d261b25
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# eu_central_bank
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/RubyMoney/eu_central_bank.
|
3
|
+
[![Build Status](https://travis-ci.org/RubyMoney/eu_central_bank.svg?branch=master)](https://travis-ci.org/RubyMoney/eu_central_bank)
|
4
4
|
|
5
5
|
## Introduction
|
6
6
|
|
@@ -52,9 +52,9 @@ eu_bank.save_rates(cache)
|
|
52
52
|
# reads the rates from the specified location
|
53
53
|
eu_bank.update_rates(cache)
|
54
54
|
|
55
|
-
if
|
56
|
-
|
57
|
-
|
55
|
+
if !eu_bank.rates_updated_at || eu_bank.rates_updated_at < Time.now - 1.days
|
56
|
+
eu_bank.save_rates(cache)
|
57
|
+
eu_bank.update_rates(cache)
|
58
58
|
end
|
59
59
|
|
60
60
|
# exchange 100 CAD to USD as usual
|
data/lib/eu_central_bank.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'open-uri'
|
3
2
|
require 'nokogiri'
|
4
3
|
require 'money'
|
@@ -12,9 +11,9 @@ class EuCentralBank < Money::Bank::VariableExchange
|
|
12
11
|
attr_accessor :historical_last_updated
|
13
12
|
attr_accessor :historical_rates_updated_at
|
14
13
|
|
15
|
-
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)
|
16
|
-
ECB_RATES_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'
|
17
|
-
ECB_90_DAY_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml'
|
14
|
+
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
|
15
|
+
ECB_RATES_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'.freeze
|
16
|
+
ECB_90_DAY_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml'.freeze
|
18
17
|
|
19
18
|
def update_rates(cache=nil)
|
20
19
|
update_parsed_rates(doc(cache))
|
metadata
CHANGED
@@ -1,64 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eu_central_bank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Shane Emmons
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-01-15 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: nokogiri
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 1.6.3
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 1.6.3
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: money
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 6.
|
33
|
+
version: 6.7.0
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: 6.
|
40
|
+
version: 6.7.0
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: 3.
|
47
|
+
version: 3.3.0
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.
|
54
|
+
version: 3.3.0
|
62
55
|
description: This gem reads exchange rates from the european central bank website.
|
63
56
|
It uses it to calculates exchange rates. It is compatible with the money gem
|
64
57
|
email:
|
@@ -67,33 +60,33 @@ executables: []
|
|
67
60
|
extensions: []
|
68
61
|
extra_rdoc_files: []
|
69
62
|
files:
|
70
|
-
- lib/eu_central_bank.rb
|
71
63
|
- CHANGELOG.md
|
72
64
|
- LICENSE
|
73
65
|
- README.md
|
74
|
-
|
66
|
+
- lib/eu_central_bank.rb
|
67
|
+
homepage: https://github.com/RubyMoney/eu_central_bank
|
75
68
|
licenses: []
|
69
|
+
metadata: {}
|
76
70
|
post_install_message:
|
77
71
|
rdoc_options: []
|
78
72
|
require_paths:
|
79
73
|
- lib
|
80
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
75
|
requirements:
|
83
|
-
- -
|
76
|
+
- - ">="
|
84
77
|
- !ruby/object:Gem::Version
|
85
78
|
version: '0'
|
86
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
-
none: false
|
88
80
|
requirements:
|
89
|
-
- -
|
81
|
+
- - ">="
|
90
82
|
- !ruby/object:Gem::Version
|
91
83
|
version: '0'
|
92
84
|
requirements: []
|
93
85
|
rubyforge_project:
|
94
|
-
rubygems_version:
|
86
|
+
rubygems_version: 2.4.5.1
|
95
87
|
signing_key:
|
96
|
-
specification_version:
|
88
|
+
specification_version: 4
|
97
89
|
summary: Calculates exchange rates based on rates from european central bank. Money
|
98
90
|
gem compatible.
|
99
91
|
test_files: []
|
92
|
+
has_rdoc:
|