ecb_exchange 0.2.0 → 0.2.1
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.
- checksums.yaml +5 -5
- data/.travis.yml +8 -0
- data/CHANGELOG.md +8 -3
- data/README.md +5 -5
- data/ecb_exchange.gemspec +0 -1
- data/lib/ecb/exchange.rb +1 -1
- data/lib/ecb/exchange/xml_feed.rb +4 -2
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 0d123594e0bca1206a50a0573a8ed60bbe1e9a18
|
|
4
|
+
data.tar.gz: 71d0475f2f5706aa590a220e838a7c75e9796164
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6bd5c7a9150578b0d9fc8ec4d17e0712091cfb0a9524539a76a3f4080226c925c704c7e8dc5b07c555b3dbe66f820c9d5f10b5f81e5e0dd4c940492c5d22140e
|
|
7
|
+
data.tar.gz: 79ec20e2975d8b7bbae7bb5c14780157c60c66b333cf5949fef72f29d2a0bc0b2a41ec33d02ebbe593a3b2db5a960452f959d39bae8d15e4922f8e96ec3d9c4b
|
data/.travis.yml
CHANGED
|
@@ -22,3 +22,11 @@ before_script:
|
|
|
22
22
|
- ./cc-test-reporter before-build - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
|
|
23
23
|
after_script:
|
|
24
24
|
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
|
25
|
+
deploy:
|
|
26
|
+
provider: rubygems
|
|
27
|
+
api_key:
|
|
28
|
+
secure: OI1RxuPuZjF6T/nceKxPLgaxjqDPKH93rNisQ5YadS8sejSa8Luv72p2JmVdXIfkk/fe0KKU6VIq0wa+LKmnOzXaECU/Cibw8LWJ5ezxNQ/pYktTVk5fTGOIvkX8gMX+HomX92TKEM4D5lZIWZhTHm+bzF0B2mXtMOkDRwEDrxdkXCRAt6rINVEbqiBUK2fGEtJoYBvlz4jS98/5DROEwNQKcNk0JEoOY4CBURpLhAH/kW0qW7P4gL3rQbm8smSvvwdcnLnu1rPr5IotGvUry1yKkPpwFhJz86jmQCtEnVCh3OJ+l24Wz79SvVFKRrQh2SZzjO5QVQ4RLqE5OEI6ghDrfjBLx1JGziaPapBiqaCHxHNKAMOa8UHH0JBa00cDzGrHK52IQxA3Emmy0voLzTFEu8z+pOhN5zSxCaDJufedMHkAmutF4sElgnZjgeckB2GVNHlJn1Dv7Ao6M12zRzYxd0RviqKYGb/alrwrKiMo2g0dTz5PsVHi/iEFGHkqBXddCv6tMX04I+9rW61wemCf6Use1c0msLcZzFSfYutSYqk4/vtWtyVprW1VRGcnImaKrzACIWhtGnqazv6PfGVlvPgiTdevG80MiJnuba0sYSlMXFqToxbLv5oO3umMp1tfeueNtWXkx+gZoph0fvJtS2pbqY1ovyk0WhVGzSE=
|
|
29
|
+
gem: ecb_exchange
|
|
30
|
+
on:
|
|
31
|
+
tags: true
|
|
32
|
+
repo: matthutchinson/ecb_exchange
|
data/CHANGELOG.md
CHANGED
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
The format is based on [Keep a Changelog]
|
|
6
|
-
adheres to [Semantic Versioning]
|
|
5
|
+
The format is based on [Keep a Changelog][KeepAChangelog] and this project
|
|
6
|
+
adheres to [Semantic Versioning][Semver].
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
10
|
- Your contribution here!
|
|
11
11
|
|
|
12
|
+
## [0.2.1] - 2019-06-24
|
|
13
|
+
### Changed
|
|
14
|
+
- use `https` endpoint for ECB XML feed (not http, which now redirects)
|
|
15
|
+
|
|
12
16
|
## [0.2.0] - 2019-04-22
|
|
13
17
|
### Changed
|
|
14
18
|
- Require at least Ruby 2.3 - earlier versions no longer supported.
|
|
@@ -27,7 +31,8 @@ adheres to [Semantic Versioning](Semver).
|
|
|
27
31
|
### Added
|
|
28
32
|
- Initial version released.
|
|
29
33
|
|
|
30
|
-
[Unreleased]: https://github.com/matthutchinson/ecb_exchange/compare/v0.2.
|
|
34
|
+
[Unreleased]: https://github.com/matthutchinson/ecb_exchange/compare/v0.2.1...HEAD
|
|
35
|
+
[0.2.1]: https://github.com/matthutchinson/ecb_exchange/compare/v0.2.0...v0.2.1
|
|
31
36
|
[0.2.0]: https://github.com/matthutchinson/ecb_exchange/compare/v0.1.2...v0.2.0
|
|
32
37
|
[0.1.2]: https://github.com/matthutchinson/ecb_exchange/compare/v0.1.1...v0.1.2
|
|
33
38
|
[0.1.1]: https://github.com/matthutchinson/ecb_exchange/compare/v0.1.0...v0.1.1
|
data/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# ECB Exchange
|
|
2
2
|
|
|
3
3
|
[](http://rubygems.org/gems/ecb_exchange)
|
|
4
|
-
[](https://travis-ci.
|
|
4
|
+
[](https://travis-ci.com/matthutchinson/ecb_exchange)
|
|
5
5
|
[](https://depfu.com/github/matthutchinson/ecb_exchange)
|
|
6
6
|
[](https://codeclimate.com/github/matthutchinson/ecb_exchange/maintainability)
|
|
7
7
|
[](https://codeclimate.com/github/matthutchinson/ecb_exchange/test_coverage)
|
|
8
8
|
|
|
9
9
|
Currency conversion using the European Central Bank's foreign [exchange
|
|
10
|
-
rates](
|
|
10
|
+
rates](https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml). Rates
|
|
11
11
|
for the last 90 days are fetched and cached on demand. All calculations are
|
|
12
12
|
performed and returned as `BigDecimal` (usually a [good
|
|
13
13
|
idea](https://makandracards.com/makandra/1178-bigdecimal-arithmetic-in-ruby)
|
|
@@ -67,7 +67,7 @@ ECB::Exchange::XMLFeed.endpoint = "http://my-awesome-service.com/feed.xml"
|
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
The XML feed at this endpoint must conform to the [ECB
|
|
70
|
-
rates](
|
|
70
|
+
rates](https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml)
|
|
71
71
|
structure.
|
|
72
72
|
|
|
73
73
|
## Handling Errors
|
|
@@ -134,7 +134,7 @@ Bug [reports](https://github.com/matthutchinson/ecb_exchange/issues) and [pull
|
|
|
134
134
|
requests](https://github.com/matthutchinson/ecb_exchange/pulls) are welcome on
|
|
135
135
|
GitHub. When submitting pull requests, remember to add tests covering any new
|
|
136
136
|
behaviour, and ensure all tests are passing on
|
|
137
|
-
[Travis](https://travis-ci.
|
|
137
|
+
[Travis](https://travis-ci.com/matthutchinson/ecb_exchange). Read the
|
|
138
138
|
[contributing
|
|
139
139
|
guidelines](https://github.com/matthutchinson/ecb_exchange/blob/master/CONTRIBUTING.md)
|
|
140
140
|
for more details.
|
|
@@ -158,7 +158,7 @@ The code is available as open source under the terms of
|
|
|
158
158
|
## Links
|
|
159
159
|
|
|
160
160
|
* [Gem](http://rubygems.org/gems/ecb_exchange)
|
|
161
|
-
* [Travis CI](https://travis-ci.
|
|
161
|
+
* [Travis CI](https://travis-ci.com/matthutchinson/ecb_exchange)
|
|
162
162
|
* [Maintainability](https://codeclimate.com/github/matthutchinson/ecb_exchange/maintainability)
|
|
163
163
|
* [Test Coverage](https://codeclimate.com/github/matthutchinson/ecb_exchange/test_coverage)
|
|
164
164
|
* [RDoc](http://rdoc.info/projects/matthutchinson/ecb_exchange)
|
data/ecb_exchange.gemspec
CHANGED
data/lib/ecb/exchange.rb
CHANGED
|
@@ -8,7 +8,7 @@ module ECB
|
|
|
8
8
|
module Exchange
|
|
9
9
|
class XMLFeed
|
|
10
10
|
|
|
11
|
-
NINETY_DAY_ENDPOINT = "
|
|
11
|
+
NINETY_DAY_ENDPOINT = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml".freeze
|
|
12
12
|
@endpoint = URI(NINETY_DAY_ENDPOINT)
|
|
13
13
|
|
|
14
14
|
# allow a configurable endpoint
|
|
@@ -44,7 +44,9 @@ module ECB
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def self.get_xml
|
|
47
|
-
|
|
47
|
+
http = Net::HTTP.new(endpoint.host, endpoint.port)
|
|
48
|
+
http.use_ssl = endpoint.scheme === "https"
|
|
49
|
+
resp = http.get(endpoint.path)
|
|
48
50
|
if resp.code == "200"
|
|
49
51
|
resp.body
|
|
50
52
|
else
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ecb_exchange
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthew Hutchinson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-06-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -169,7 +169,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
169
169
|
- !ruby/object:Gem::Version
|
|
170
170
|
version: '0'
|
|
171
171
|
requirements: []
|
|
172
|
-
|
|
172
|
+
rubyforge_project:
|
|
173
|
+
rubygems_version: 2.5.2.3
|
|
173
174
|
signing_key:
|
|
174
175
|
specification_version: 4
|
|
175
176
|
summary: Currency conversion using the European Central Bank's foreign exchange rates.
|