uruguayan_exchange_rates 0.0.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 +7 -0
- data/.gitignore +22 -0
- data/.rspec +2 -0
- data/.travis.yml +15 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +57 -0
- data/Rakefile +10 -0
- data/lib/uruguayan_exchange_rates.rb +29 -0
- data/lib/uruguayan_exchange_rates/constants.rb +20 -0
- data/lib/uruguayan_exchange_rates/enumeration.rb +28 -0
- data/lib/uruguayan_exchange_rates/error.rb +10 -0
- data/lib/uruguayan_exchange_rates/util.rb +38 -0
- data/lib/uruguayan_exchange_rates/version.rb +3 -0
- data/spec/exchange_rates_spec.rb +48 -0
- data/spec/spec_helper.rb +91 -0
- data/uruguayan_exchange_rates.gemspec +25 -0
- metadata +118 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: eb93362ca62e2dfe9ac27897819487d1d89ea939
|
|
4
|
+
data.tar.gz: da06a9b4763d3a5fc1f18ac992c346ba677ac15b
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b62337d1cb332ddb558f8b59475fd131f40e8d59b6d850662fa8da2bea60a1ec3dc535ff1aaefa655f62dbd4781cd275f7ed52dd5c2af140379268b874de6e10
|
|
7
|
+
data.tar.gz: 72431aa54a422986cd544ed96d769c83888f088494ba1a27cccc7de69846809c324bbfb61b424d43343019bf13d36f6e2c1127396ad2552b716808410a3fb8a2
|
data/.gitignore
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
.bundle
|
|
4
|
+
.config
|
|
5
|
+
.yardoc
|
|
6
|
+
Gemfile.lock
|
|
7
|
+
InstalledFiles
|
|
8
|
+
_yardoc
|
|
9
|
+
coverage
|
|
10
|
+
doc/
|
|
11
|
+
lib/bundler/man
|
|
12
|
+
pkg
|
|
13
|
+
rdoc
|
|
14
|
+
spec/reports
|
|
15
|
+
test/tmp
|
|
16
|
+
test/version_tmp
|
|
17
|
+
tmp
|
|
18
|
+
*.bundle
|
|
19
|
+
*.so
|
|
20
|
+
*.o
|
|
21
|
+
*.a
|
|
22
|
+
mkmf.log
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2015 Juan Pablo Balarini
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Uruguayan Exchange Rates
|
|
2
|
+
|
|
3
|
+
[](https://codeclimate.com/github/jpbalarini/uruguayan_exchange_rates)
|
|
4
|
+
[](https://travis-ci.org/jpbalarini/uruguayan_exchange_rates)
|
|
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.
|
|
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
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Add this line to your application's Gemfile:
|
|
12
|
+
|
|
13
|
+
gem 'uruguayan_exchange_rates'
|
|
14
|
+
|
|
15
|
+
And then execute:
|
|
16
|
+
|
|
17
|
+
$ bundle
|
|
18
|
+
|
|
19
|
+
Or install it yourself as:
|
|
20
|
+
|
|
21
|
+
$ gem install uruguayan_exchange_rates
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Usage is simple, just call the exchange_rates method with a valid key:
|
|
26
|
+
|
|
27
|
+
UruguayanExchangeRates.exchange_rates(:UYU_USD)
|
|
28
|
+
|
|
29
|
+
It should return an array with two elements, buy and sell values respectively:
|
|
30
|
+
|
|
31
|
+
[25.95, 26.75]
|
|
32
|
+
|
|
33
|
+
Supported keys are:
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
:UYU_USD => 'Dólar',
|
|
37
|
+
:UYU_EUR => 'Euro',
|
|
38
|
+
:UYU_ARS => 'Peso Argentino',
|
|
39
|
+
:UYU_BRL => 'Real',
|
|
40
|
+
:USD_GPD => 'Dólares USA por Libra esterlina',
|
|
41
|
+
:CHF_USD => 'Francos suizos por Dólar',
|
|
42
|
+
:JPY_USD => 'Yens por Dólar',
|
|
43
|
+
:USD_EUR => 'Dólares USA por Euro',
|
|
44
|
+
:ARS_USD => 'Pesos Argentinos por Dólar',
|
|
45
|
+
:BRL_USD => 'Reales por Dólar',
|
|
46
|
+
:PYG_USD => 'Guaraníes por Dólar',
|
|
47
|
+
:UYU_UI => 'Unidad Indexada',
|
|
48
|
+
:USD_ONZATROY => 'Onza Troy de Oro'
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
## Contributing
|
|
52
|
+
|
|
53
|
+
1. Fork it ( https://github.com/jpbalarini/uruguayan_exchange_rates/fork )
|
|
54
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
55
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
56
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
57
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require 'uruguayan_exchange_rates/version'
|
|
2
|
+
require 'uruguayan_exchange_rates/constants'
|
|
3
|
+
require 'uruguayan_exchange_rates/error'
|
|
4
|
+
require 'uruguayan_exchange_rates/util'
|
|
5
|
+
|
|
6
|
+
# TODO: remove nokogiri and add a regular expression
|
|
7
|
+
# TODO: compare in lowercase
|
|
8
|
+
|
|
9
|
+
module UruguayanExchangeRates
|
|
10
|
+
SERVICE_HOST = 'http://www.bancorepublica.com.uy'
|
|
11
|
+
SERVICE_PATH = '/web/guest/institucional/cotizaciones'
|
|
12
|
+
|
|
13
|
+
def self.exchange_rates(currency)
|
|
14
|
+
currency_raw = Constants[currency]
|
|
15
|
+
raise InvalidCurrency, 'Invalid currency' if currency_raw.nil?
|
|
16
|
+
|
|
17
|
+
util = Util.new(currency_raw: currency_raw)
|
|
18
|
+
# Make request
|
|
19
|
+
data = util.request_data
|
|
20
|
+
|
|
21
|
+
# Find currency in page
|
|
22
|
+
currency_data = util.find_currency(data)
|
|
23
|
+
|
|
24
|
+
raise CurrencyNotFound, 'Currency not found' if currency_data.nil?
|
|
25
|
+
|
|
26
|
+
# Get values
|
|
27
|
+
util.extract_values(currency_data)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
require_relative 'enumeration'
|
|
3
|
+
|
|
4
|
+
module UruguayanExchangeRates
|
|
5
|
+
class Constants < Enumeration
|
|
6
|
+
self.add_item(:UYU_USD, 'Dólar')
|
|
7
|
+
self.add_item(:UYU_EUR, 'Euro')
|
|
8
|
+
self.add_item(:UYU_ARS, 'Peso Argentino')
|
|
9
|
+
self.add_item(:UYU_BRL, 'Real')
|
|
10
|
+
self.add_item(:USD_GPD, 'Dólares USA por Libra esterlina')
|
|
11
|
+
self.add_item(:CHF_USD, 'Francos suizos por Dólar')
|
|
12
|
+
self.add_item(:JPY_USD, 'Yens por Dólar')
|
|
13
|
+
self.add_item(:USD_EUR, 'Dólares USA por Euro')
|
|
14
|
+
self.add_item(:ARS_USD, 'Pesos Argentinos por Dólar')
|
|
15
|
+
self.add_item(:BRL_USD, 'Reales por Dólar')
|
|
16
|
+
self.add_item(:PYG_USD, 'Guaraníes por Dólar')
|
|
17
|
+
self.add_item(:UYU_UI, 'Unidad Indexada')
|
|
18
|
+
self.add_item(:USD_ONZATROY, 'Onza Troy de Oro')
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module UruguayanExchangeRates
|
|
2
|
+
class Enumeration
|
|
3
|
+
def Enumeration.add_item(key, value)
|
|
4
|
+
@hash ||= {}
|
|
5
|
+
@hash[key] = value
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def Enumeration.const_missing(key)
|
|
9
|
+
@hash[key]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def Enumeration.each
|
|
13
|
+
@hash.each { |key, value| yield(key, value) }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def Enumeration.values
|
|
17
|
+
@hash.values || []
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def Enumeration.keys
|
|
21
|
+
@hash.keys || []
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def Enumeration.[](key)
|
|
25
|
+
@hash[key]
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module UruguayanExchangeRates
|
|
2
|
+
# Custom error class for rescuing from all UruguayanExchangeRates errors
|
|
3
|
+
class Error < StandardError; end
|
|
4
|
+
|
|
5
|
+
# Raised when invalid currency is passed
|
|
6
|
+
class InvalidCurrency < Error; end
|
|
7
|
+
|
|
8
|
+
# Raised when currency is not found on the page
|
|
9
|
+
class CurrencyNotFound < Error; end
|
|
10
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require 'net/http'
|
|
2
|
+
require 'nokogiri'
|
|
3
|
+
|
|
4
|
+
module UruguayanExchangeRates
|
|
5
|
+
class Util
|
|
6
|
+
attr_accessor :currency_raw
|
|
7
|
+
|
|
8
|
+
def initialize(options = {})
|
|
9
|
+
unless block_given?
|
|
10
|
+
options.each do |key, value|
|
|
11
|
+
send(:"#{key}=", value)
|
|
12
|
+
end
|
|
13
|
+
else
|
|
14
|
+
yield(self)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def request_data
|
|
19
|
+
uri = URI.parse(SERVICE_HOST + SERVICE_PATH)
|
|
20
|
+
result = Net::HTTP.get(uri)
|
|
21
|
+
data = Nokogiri::HTML(result)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def find_currency(data)
|
|
25
|
+
values = data.css('#exchangeRatesLarge').at('tr:contains("' + currency_raw + '")')
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def extract_values(currency_data)
|
|
29
|
+
# Remove unnecessary spaces
|
|
30
|
+
values = currency_data.text.strip
|
|
31
|
+
# Remove name
|
|
32
|
+
values.gsub!(currency_raw, '')
|
|
33
|
+
# Remove spaces
|
|
34
|
+
values.gsub!(/(?:\n\r?|\r\n?)/, ' ').strip!
|
|
35
|
+
buy, sell = values.split(/\s+/).map{ |v| v.to_f }
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'uruguayan_exchange_rates'
|
|
3
|
+
|
|
4
|
+
describe UruguayanExchangeRates do
|
|
5
|
+
context 'with valid params' do
|
|
6
|
+
it 'should return 2 parameters' do
|
|
7
|
+
UruguayanExchangeRates::Constants.keys.each do |key|
|
|
8
|
+
expect(UruguayanExchangeRates::exchange_rates(key)[0]).to be > 0.0
|
|
9
|
+
expect(UruguayanExchangeRates::exchange_rates(key)[1]).to be > 0.0
|
|
10
|
+
expect(UruguayanExchangeRates::exchange_rates(key).count).to eq(2)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
context 'with invalid params' do
|
|
16
|
+
it 'should return InvalidCurrency' do
|
|
17
|
+
expect{
|
|
18
|
+
UruguayanExchangeRates::exchange_rates('foo')
|
|
19
|
+
}.to raise_error(UruguayanExchangeRates::InvalidCurrency)
|
|
20
|
+
expect{
|
|
21
|
+
UruguayanExchangeRates::exchange_rates(2)
|
|
22
|
+
}.to raise_error(UruguayanExchangeRates::InvalidCurrency)
|
|
23
|
+
expect{
|
|
24
|
+
UruguayanExchangeRates::exchange_rates(:FOO_BAR)
|
|
25
|
+
}.to raise_error(UruguayanExchangeRates::InvalidCurrency)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'should return CurrencyNotFound' do
|
|
29
|
+
# Add test element to Constants
|
|
30
|
+
UruguayanExchangeRates::Constants.add_item(:FOO_BAR, 'Foo_bar')
|
|
31
|
+
expect{
|
|
32
|
+
UruguayanExchangeRates::exchange_rates(:FOO_BAR)
|
|
33
|
+
}.to raise_error(UruguayanExchangeRates::CurrencyNotFound)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
context 'with bad URI' do
|
|
38
|
+
it 'should return an error' do
|
|
39
|
+
# Change host
|
|
40
|
+
stub_const('UruguayanExchangeRates::SERVICE_HOST', 'SOME_BAD_HOST')
|
|
41
|
+
# Get some currency
|
|
42
|
+
currency = UruguayanExchangeRates::Constants.keys.first
|
|
43
|
+
expect{
|
|
44
|
+
UruguayanExchangeRates::exchange_rates(currency)
|
|
45
|
+
}.to raise_error
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
|
5
|
+
# files.
|
|
6
|
+
#
|
|
7
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
|
8
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
|
9
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
|
10
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
|
11
|
+
# a separate helper file that requires the additional dependencies and performs
|
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
|
13
|
+
# it.
|
|
14
|
+
#
|
|
15
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
|
16
|
+
# users commonly want.
|
|
17
|
+
#
|
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
19
|
+
RSpec.configure do |config|
|
|
20
|
+
# rspec-expectations config goes here. You can use an alternate
|
|
21
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
|
22
|
+
# assertions if you prefer.
|
|
23
|
+
config.expect_with :rspec do |expectations|
|
|
24
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
|
25
|
+
# and `failure_message` of custom matchers include text for helper methods
|
|
26
|
+
# defined using `chain`, e.g.:
|
|
27
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
|
28
|
+
# # => "be bigger than 2 and smaller than 4"
|
|
29
|
+
# ...rather than:
|
|
30
|
+
# # => "be bigger than 2"
|
|
31
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
|
35
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
|
36
|
+
config.mock_with :rspec do |mocks|
|
|
37
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
|
38
|
+
# a real object. This is generally recommended, and will default to
|
|
39
|
+
# `true` in RSpec 4.
|
|
40
|
+
mocks.verify_partial_doubles = true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# The settings below are suggested to provide a good initial experience
|
|
44
|
+
# with RSpec, but feel free to customize to your heart's content.
|
|
45
|
+
=begin
|
|
46
|
+
# These two settings work together to allow you to limit a spec run
|
|
47
|
+
# to individual examples or groups you care about by tagging them with
|
|
48
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
|
49
|
+
# get run.
|
|
50
|
+
config.filter_run :focus
|
|
51
|
+
config.run_all_when_everything_filtered = true
|
|
52
|
+
|
|
53
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
|
54
|
+
# recommended. For more details, see:
|
|
55
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
|
56
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
|
57
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
|
58
|
+
config.disable_monkey_patching!
|
|
59
|
+
|
|
60
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
|
61
|
+
# be too noisy due to issues in dependencies.
|
|
62
|
+
config.warnings = true
|
|
63
|
+
|
|
64
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
|
65
|
+
# file, and it's useful to allow more verbose output when running an
|
|
66
|
+
# individual spec file.
|
|
67
|
+
if config.files_to_run.one?
|
|
68
|
+
# Use the documentation formatter for detailed output,
|
|
69
|
+
# unless a formatter has already been configured
|
|
70
|
+
# (e.g. via a command-line flag).
|
|
71
|
+
config.default_formatter = 'doc'
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Print the 10 slowest examples and example groups at the
|
|
75
|
+
# end of the spec run, to help surface which specs are running
|
|
76
|
+
# particularly slow.
|
|
77
|
+
config.profile_examples = 10
|
|
78
|
+
|
|
79
|
+
# Run specs in random order to surface order dependencies. If you find an
|
|
80
|
+
# order dependency and want to debug it, you can fix the order by providing
|
|
81
|
+
# the seed, which is printed after each run.
|
|
82
|
+
# --seed 1234
|
|
83
|
+
config.order = :random
|
|
84
|
+
|
|
85
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
|
86
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
|
87
|
+
# test failures related to randomization by passing the same `--seed` value
|
|
88
|
+
# as the one that triggered the failure.
|
|
89
|
+
Kernel.srand config.seed
|
|
90
|
+
=end
|
|
91
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'uruguayan_exchange_rates/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = 'uruguayan_exchange_rates'
|
|
8
|
+
spec.version = UruguayanExchangeRates::VERSION
|
|
9
|
+
spec.authors = ['Juan Pablo Balarini']
|
|
10
|
+
spec.email = ['jpbalarini@gmail.com']
|
|
11
|
+
spec.summary = %q{Uruguayan exchange rates.}
|
|
12
|
+
spec.description = %q{Uruguayan exchange rates. Data is taken from the Banco Republica.}
|
|
13
|
+
spec.homepage = ''
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ['lib']
|
|
20
|
+
|
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
|
22
|
+
spec.add_development_dependency 'rake'
|
|
23
|
+
spec.add_development_dependency 'rspec'
|
|
24
|
+
spec.add_development_dependency 'nokogiri'
|
|
25
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: uruguayan_exchange_rates
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Juan Pablo Balarini
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ~>
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.6'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ~>
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.6'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - '>='
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - '>='
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rspec
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - '>='
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - '>='
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: nokogiri
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - '>='
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - '>='
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
description: Uruguayan exchange rates. Data is taken from the Banco Republica.
|
|
70
|
+
email:
|
|
71
|
+
- jpbalarini@gmail.com
|
|
72
|
+
executables: []
|
|
73
|
+
extensions: []
|
|
74
|
+
extra_rdoc_files: []
|
|
75
|
+
files:
|
|
76
|
+
- .gitignore
|
|
77
|
+
- .rspec
|
|
78
|
+
- .travis.yml
|
|
79
|
+
- Gemfile
|
|
80
|
+
- LICENSE.txt
|
|
81
|
+
- README.md
|
|
82
|
+
- Rakefile
|
|
83
|
+
- lib/uruguayan_exchange_rates.rb
|
|
84
|
+
- lib/uruguayan_exchange_rates/constants.rb
|
|
85
|
+
- lib/uruguayan_exchange_rates/enumeration.rb
|
|
86
|
+
- lib/uruguayan_exchange_rates/error.rb
|
|
87
|
+
- lib/uruguayan_exchange_rates/util.rb
|
|
88
|
+
- lib/uruguayan_exchange_rates/version.rb
|
|
89
|
+
- spec/exchange_rates_spec.rb
|
|
90
|
+
- spec/spec_helper.rb
|
|
91
|
+
- uruguayan_exchange_rates.gemspec
|
|
92
|
+
homepage: ''
|
|
93
|
+
licenses:
|
|
94
|
+
- MIT
|
|
95
|
+
metadata: {}
|
|
96
|
+
post_install_message:
|
|
97
|
+
rdoc_options: []
|
|
98
|
+
require_paths:
|
|
99
|
+
- lib
|
|
100
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
|
+
requirements:
|
|
102
|
+
- - '>='
|
|
103
|
+
- !ruby/object:Gem::Version
|
|
104
|
+
version: '0'
|
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - '>='
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '0'
|
|
110
|
+
requirements: []
|
|
111
|
+
rubyforge_project:
|
|
112
|
+
rubygems_version: 2.4.4
|
|
113
|
+
signing_key:
|
|
114
|
+
specification_version: 4
|
|
115
|
+
summary: Uruguayan exchange rates.
|
|
116
|
+
test_files:
|
|
117
|
+
- spec/exchange_rates_spec.rb
|
|
118
|
+
- spec/spec_helper.rb
|