ecb_exchange 0.2.0 → 0.2.1

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
- SHA256:
3
- metadata.gz: '0569c1270113499c32743bce9b846a4928a52389f678757789421b3f656609ba'
4
- data.tar.gz: 283f20e271bbc1bfa5c39560b30d0f1d39b052775b556e9f7373a850b3307a60
2
+ SHA1:
3
+ metadata.gz: 0d123594e0bca1206a50a0573a8ed60bbe1e9a18
4
+ data.tar.gz: 71d0475f2f5706aa590a220e838a7c75e9796164
5
5
  SHA512:
6
- metadata.gz: 6921600dfcd10a823ca657979fa6462d4b33ef0cbbcfdac6211743554c0dc15ac06a21755f1a3e7c57cda86bac4fa90149ca72b32e4fbd9bcbefebc32392de34
7
- data.tar.gz: 2d18faa58686485957e0a17e2a1bba8e6f124a518707f6f150258ec1f9e52208114bcc871ca090f0d8a8983ac476b0479ba9ef20e0d260b25fb5ef9510dd060d
6
+ metadata.gz: 6bd5c7a9150578b0d9fc8ec4d17e0712091cfb0a9524539a76a3f4080226c925c704c7e8dc5b07c555b3dbe66f820c9d5f10b5f81e5e0dd4c940492c5d22140e
7
+ data.tar.gz: 79ec20e2975d8b7bbae7bb5c14780157c60c66b333cf5949fef72f29d2a0bc0b2a41ec33d02ebbe593a3b2db5a960452f959d39bae8d15e4922f8e96ec3d9c4b
@@ -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
@@ -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](KeepAChangelog) and this project
6
- adheres to [Semantic Versioning](Semver).
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.0...HEAD
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
  [![Gem](https://img.shields.io/gem/v/ecb_exchange.svg?style=flat)](http://rubygems.org/gems/ecb_exchange)
4
- [![Travis](https://img.shields.io/travis/matthutchinson/ecb_exchange/master.svg?style=flat)](https://travis-ci.org/matthutchinson/ecb_exchange)
4
+ [![Travis](https://img.shields.io/travis/com/matthutchinson/ecb_exchange/master.svg?style=flat)](https://travis-ci.com/matthutchinson/ecb_exchange)
5
5
  [![Depfu](https://img.shields.io/depfu/matthutchinson/ecb_exchange.svg?style=flat)](https://depfu.com/github/matthutchinson/ecb_exchange)
6
6
  [![Maintainability](https://api.codeclimate.com/v1/badges/c67969dd7b921477bdcc/maintainability)](https://codeclimate.com/github/matthutchinson/ecb_exchange/maintainability)
7
7
  [![Test Coverage](https://api.codeclimate.com/v1/badges/c67969dd7b921477bdcc/test_coverage)](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](http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml). 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](http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml)
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.org/matthutchinson/ecb_exchange). Read the
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.org/matthutchinson/ecb_exchange)
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)
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  lib = File.expand_path("../lib", __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require "ecb/exchange"
@@ -5,7 +5,7 @@ require 'bigdecimal/util'
5
5
 
6
6
  module ECB
7
7
  module Exchange
8
- VERSION = "0.2.0".freeze
8
+ VERSION = "0.2.1".freeze
9
9
 
10
10
  def self.convert(amount, from:, to:, date: Date.today)
11
11
  amount.to_d * rate(from: from, to: to, date: date)
@@ -8,7 +8,7 @@ module ECB
8
8
  module Exchange
9
9
  class XMLFeed
10
10
 
11
- NINETY_DAY_ENDPOINT = "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml".freeze
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
- resp = Net::HTTP.new(endpoint.host, endpoint.port).get(endpoint.path)
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.0
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-04-22 00:00:00.000000000 Z
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
- rubygems_version: 3.0.3
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.