uruguayan_exchange_rates 0.0.1 → 1.0.0
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 +4 -4
- data/.travis.yml +1 -1
- data/README.md +3 -3
- data/lib/uruguayan_exchange_rates/util.rb +1 -0
- data/lib/uruguayan_exchange_rates/version.rb +1 -1
- data/lib/uruguayan_exchange_rates.rb +1 -4
- data/spec/exchange_rates_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea5129e3eaf6671dbf696ce2ef87be008fe10224
|
|
4
|
+
data.tar.gz: 6e1c62ebedfa4e40bf62883e26854e8ea503314d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 34fb69c04dd4c50dc783bc42032e76dd7e396c2ccf91ee989b3ebe5819ea0415996e8a9102f417eb36ef75cf05993e1777da6c6e1b4081ba0cd57793ece9a54f
|
|
7
|
+
data.tar.gz: 5e4d8a80e048659b3976533cd440aa4b2fe6aad3216df6b19dc42831a01d55789ff59e1259297f06324bad4840c07dfd2720ac1a4ac42a4cb112f5550b4b24f2
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://codeclimate.com/github/jpbalarini/uruguayan_exchange_rates)
|
|
4
4
|
[](https://travis-ci.org/jpbalarini/uruguayan_exchange_rates)
|
|
5
5
|
|
|
6
|
-
With this gem you can get the official Uruguayan exchange rates (buy and sell) for multiple currencies. Data is taken from Banco República.
|
|
6
|
+
With this gem you can get the official Uruguayan exchange rates (buy and sell values) for multiple currencies. Data is taken from Banco República.
|
|
7
7
|
This gem was designed for a project where I needed to update the price of some elements daily, using the official Uruguayan exchange rates.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
@@ -26,9 +26,9 @@ Usage is simple, just call the exchange_rates method with a valid key:
|
|
|
26
26
|
|
|
27
27
|
UruguayanExchangeRates.exchange_rates(:UYU_USD)
|
|
28
28
|
|
|
29
|
-
It should return
|
|
29
|
+
It should return a hash with two elements, buy and sell values respectively:
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
{:buy=>28.0, :sell=>28.8}
|
|
32
32
|
|
|
33
33
|
Supported keys are:
|
|
34
34
|
|
|
@@ -3,12 +3,9 @@ require 'uruguayan_exchange_rates/constants'
|
|
|
3
3
|
require 'uruguayan_exchange_rates/error'
|
|
4
4
|
require 'uruguayan_exchange_rates/util'
|
|
5
5
|
|
|
6
|
-
# TODO: remove nokogiri and add a regular expression
|
|
7
|
-
# TODO: compare in lowercase
|
|
8
|
-
|
|
9
6
|
module UruguayanExchangeRates
|
|
10
7
|
SERVICE_HOST = 'http://www.bancorepublica.com.uy'
|
|
11
|
-
SERVICE_PATH = '/
|
|
8
|
+
SERVICE_PATH = '/c/portal/render_portlet?p_l_id=123137&p_p_id=ExchangeLarge_WAR_ExchangeRate5121_INSTANCE_P2Af'
|
|
12
9
|
|
|
13
10
|
def self.exchange_rates(currency)
|
|
14
11
|
currency_raw = Constants[currency]
|
data/spec/exchange_rates_spec.rb
CHANGED
|
@@ -5,8 +5,8 @@ describe UruguayanExchangeRates do
|
|
|
5
5
|
context 'with valid params' do
|
|
6
6
|
it 'should return 2 parameters' do
|
|
7
7
|
UruguayanExchangeRates::Constants.keys.each do |key|
|
|
8
|
-
expect(UruguayanExchangeRates::exchange_rates(key)[
|
|
9
|
-
expect(UruguayanExchangeRates::exchange_rates(key)[
|
|
8
|
+
expect(UruguayanExchangeRates::exchange_rates(key)[:buy]).to be > 0.0
|
|
9
|
+
expect(UruguayanExchangeRates::exchange_rates(key)[:sell]).to be > 0.0
|
|
10
10
|
expect(UruguayanExchangeRates::exchange_rates(key).count).to eq(2)
|
|
11
11
|
end
|
|
12
12
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: uruguayan_exchange_rates
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juan Pablo Balarini
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-07-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
109
109
|
version: '0'
|
|
110
110
|
requirements: []
|
|
111
111
|
rubyforge_project:
|
|
112
|
-
rubygems_version: 2.
|
|
112
|
+
rubygems_version: 2.2.2
|
|
113
113
|
signing_key:
|
|
114
114
|
specification_version: 4
|
|
115
115
|
summary: Uruguayan exchange rates.
|