Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Link to matiu/dolar-blue at README.md
Browse files Browse the repository at this point in the history
Update .travis.yml with up to date Ruby versions

Added link to codealchemist/hubot-dolar-blue

Fix source url. Upgrade to rspec 3. Upgrade Ruby & others. Fix LICENSE.

Fix travis rbx with rubinius-2.5.7

Ruby 2.2.4, dollar Bolsa, xpath

Fix new xpath selectors, remove rbx
  • Loading branch information
elgalu committed Dec 19, 2015
1 parent 8e15618 commit 8ae9333
Show file tree
Hide file tree
Showing 19 changed files with 167 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
@@ -1 +1 @@
2.1.1
2.2.4
7 changes: 2 additions & 5 deletions .travis.yml
@@ -1,11 +1,8 @@
language: ruby

rvm:
- 1.9.3
- 2.0.0
- 2.1.1
- jruby-1.7.12
- rbx-2.2.6
- 2.2.4
- jruby-9

before_install:
- travis_retry gem install bundler
Expand Down
29 changes: 28 additions & 1 deletion CHANGELOG.md
@@ -1,4 +1,4 @@
## [In git](https://github.com/elgalu/dolarblue/compare/v0.5.1...HEAD)
## [In git](https://github.com/elgalu/dolarblue/compare/v0.6.0...HEAD)

### New Features
* n/a
Expand All @@ -7,6 +7,33 @@
* n/a

### Chores
* n/a

## [v0.6.0](https://github.com/elgalu/dolarblue/tree/v0.6.0)

### New Features
* Repalce dollar "card" with "bolsa" aka stock

### Bug Fixes
* Fix new xpath selectors
* Remove rubinius from build

### Chores
* Use latest Ruby 2.2.4
* Use latest jruby-9 in travis

## [v0.5.2](https://github.com/elgalu/dolarblue/tree/v0.5.2)

### New Features
* n/a

### Bug Fixes
* Fix source url since they added www. (Leo Gallucci)
* Move license from MIT to more permissive Apache 2.0

### Chores
* Upgrade from rspec 2 to rspec 3. (Leo Gallucci)
* Upgrade Ruby version to 2.2.2.
* Travis fixes. (Leo Gallucci)

## [v0.5.1](https://github.com/elgalu/dolarblue/tree/v0.5.1)
Expand Down
19 changes: 11 additions & 8 deletions Gemfile
Expand Up @@ -3,22 +3,25 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in dolarblue.gemspec
gemspec

group :development do
gem 'pry' # core replacement for irb
gem 'pry-doc' # gives MRI core documentation and source code
end
# installing pry doesn't work anymore (ruby 2.2.2)
# group :development do
# gem 'pry' # core replacement for irb
# gem 'pry-doc' # gives MRI core documentation and source code
# end

unless %w(jruby rbx).include? RUBY_ENGINE
group :test do
# Coverage reports only for MRI
gem 'simplecov', '>= 0.8.2'
gem 'coveralls', '>= 0.7.0'
# https://github.com/colszowka/simplecov/releases
gem 'simplecov', '>= 0.10.0'
# https://github.com/lemurheavy/coveralls-ruby/releases
gem 'coveralls', '>= 0.7.12'
end

group :development do
gem 'redcarpet', '>= 3.1.1' # redcarpet doesn't currently works with jruby nor rbx. kramdown is a possible alternative
gem 'yard', '>= 0.8.7.4' # no need to generate yard docs from jruby nor rbx
gem 'pry-stack_explorer' # adds command `show-stack`
gem 'pry-debugger' # adds commands `continue, step, next, finish`
# gem 'pry-stack_explorer' # adds command `show-stack`
# gem 'pry-debugger' # adds commands `continue, step, next, finish`
end
end
147 changes: 69 additions & 78 deletions Gemfile.lock
@@ -1,101 +1,92 @@
PATH
remote: .
specs:
dolarblue (0.5.1)
configatron (~> 3.1, >= 3.1.3)
nokogiri (~> 1.6, >= 1.6.1)
dolarblue (0.6.0)
configatron (~> 3.2, >= 3.2.0)
nokogiri (~> 1.6, >= 1.6.2)

GEM
remote: https://rubygems.org/
specs:
addressable (2.3.6)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
coderay (1.1.0)
columnize (0.8.9)
configatron (3.1.3)
coveralls (0.7.0)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
crack (0.4.2)
addressable (2.4.0)
configatron (3.2.0)
coveralls (0.8.10)
json (~> 1.8)
rest-client (>= 1.6.8, < 2)
simplecov (~> 0.11.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (~> 1.6.0)
crack (0.4.3)
safe_yaml (~> 1.0.0)
debug_inspector (0.0.2)
debugger (1.6.6)
columnize (>= 0.3.1)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.3.2)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.3.2)
diff-lcs (1.2.5)
docile (1.1.3)
method_source (0.8.2)
mime-types (2.2)
mini_portile (0.5.3)
multi_json (1.9.3)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
slop (~> 3.4)
pry-debugger (0.2.2)
debugger (~> 1.3)
pry (~> 0.9.10)
pry-doc (0.6.0)
pry (~> 0.9)
yard (~> 0.8)
pry-stack_explorer (0.4.9.1)
binding_of_caller (>= 0.7)
pry (>= 0.9.11)
rake (10.3.1)
redcarpet (3.1.1)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
docile (1.1.5)
domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
hashdiff (0.2.3)
http-cookie (1.0.2)
domain_name (~> 0.5)
json (1.8.3)
mime-types (2.99)
mini_portile2 (2.0.0)
netrc (0.11.0)
nokogiri (1.6.7.1)
mini_portile2 (~> 2.0.0.rc2)
rake (10.4.2)
redcarpet (3.3.3)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.1)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
rubygems-tasks (0.2.4)
safe_yaml (1.0.3)
simplecov (0.8.2)
safe_yaml (1.0.4)
simplecov (0.11.1)
docile (~> 1.1.0)
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
slop (3.5.0)
term-ansicolor (1.3.0)
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
term-ansicolor (1.3.2)
tins (~> 1.0)
thor (0.19.1)
tins (1.1.0)
vcr (2.9.0)
webmock (1.17.4)
addressable (>= 2.2.7)
tins (1.6.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
vcr (2.9.3)
webmock (1.22.3)
addressable (>= 2.3.6)
crack (>= 0.3.2)
yard (0.8.7.4)
hashdiff
yard (0.8.7.6)

PLATFORMS
ruby

DEPENDENCIES
bundler (~> 1.6, >= 1.6.2)
coveralls (>= 0.7.0)
bundler (~> 1.10, >= 1.10.4)
coveralls (>= 0.7.12)
dolarblue!
pry
pry-debugger
pry-doc
pry-stack_explorer
rake (~> 10.3, >= 10.3.1)
rake (~> 10.4, >= 10.4.2)
redcarpet (>= 3.1.1)
rspec (~> 2.14, >= 2.14.1)
rspec (~> 3.3, >= 3.3.0)
rubygems-tasks (~> 0.2, >= 0.2.4)
simplecov (>= 0.8.2)
vcr (~> 2.9, >= 2.9.0)
webmock (~> 1.17, >= 1.17.4)
simplecov (>= 0.10.0)
vcr (~> 2.9, >= 2.9.3)
webmock (~> 1.21, >= 1.21.0)
yard (>= 0.8.7.4)

BUNDLED WITH
1.11.2
21 changes: 1 addition & 20 deletions LICENSE.md
@@ -1,22 +1,3 @@
Copyright (c) 2014 Leo Gallucci

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The project is made possible by volunteer contributors who have put in thousands of hours of their own time, and made the source code freely available under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0).
19 changes: 12 additions & 7 deletions README.md
Expand Up @@ -7,6 +7,8 @@
[![Coverage Status][CS img]][Coverage Status]
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/4a6a5549e2d3b59f3b59b12ab0ab70e9 "githalytics.com")](http://githalytics.com/elgalu/dolarblue)

**Update**: You may also be intersted in [codealchemist/hubot-dolar-blue][] and [matiu/dolar-blue][]

## Description

Query Argentine Peso vs US$ exchange values with particular interest in official vs. street (blue) reference prices.
Expand All @@ -28,17 +30,17 @@ Query latest values
Sample result:

Obtaining latest AR$ vs US$ exchange values...Parsing values...
Done: 2013-12-15 19:20:41 -0300
Done: 2015-12-18 19:50:28 -0300

- Dollar Official....: 6.25 / 6.30
- Dollar Card........: n/a / 8.50
- Dollar Blue........: 9.55 / 9.60
- Dollar Official....: 13.30 / 13.60
- Dollar Bolsa.......: n/a / 13.71
- Dollar Blue........: 14.05 / 14.20

- Gap card.......blue: 13%
- Gap official...blue: 52%
- Gap bolsa......blue: 4%
- Gap official...blue: 4%

Information source:
http://ambito.com/economia/mercados/monedas/dolar/
http://www.ambito.com/economia/mercados/monedas/dolar/

## Contributing

Expand Down Expand Up @@ -84,3 +86,6 @@ Released under the MIT License. See the [LICENSE][] file for further details.

[blue]: http://latino.foxnews.com/latino/news/2012/05/19/argentina-currency-black-market-expands/
[real value]: http://www.buenosairesherald.com/tags/dollar

[codealchemist/hubot-dolar-blue]: https://github.com/codealchemist/hubot-dolar-blue
[matiu/dolar-blue]: https://github.com/matiu/dolar-blue
2 changes: 1 addition & 1 deletion bin/cardblue → bin/bolsablue
Expand Up @@ -2,6 +2,6 @@
require 'dolarblue'

while true
$stdout.puts Dolarblue.get_cardblue_output
$stdout.puts Dolarblue.get_bolsabolsa_output
sleep 60*5 # every 5 minutes
end
8 changes: 4 additions & 4 deletions config/xpaths.yml
@@ -1,17 +1,17 @@
base_url: 'http://ambito.com/economia/mercados/monedas/dolar/'
base_url: 'http://www.ambito.com/economia/mercados/monedas/dolar/'

blue:
buy:
xpath: '//*[@id="contenido"]/div[2]/div/div/div[2]/big'
xpath: '//*[@id="contenido"]/div[1]/div[2]/div/div/div[2]/big'
sell:
xpath: '//*[@id="contenido"]/div[2]/div/div/div[3]/big'
xpath: '//*[@id="contenido"]/div[1]/div[2]/div/div/div[3]/big'

official:
buy:
xpath: '//*[@id="contenido"]/div[1]/div[1]/div/div/div[2]/big'
sell:
xpath: '//*[@id="contenido"]/div[1]/div[1]/div/div/div[3]/big'

card:
bolsa:
sell:
xpath: '//*[@id="contenido"]/div[4]/div/div/div[2]/big'
16 changes: 8 additions & 8 deletions dolarblue.gemspec
Expand Up @@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
spec.summary = %q{Query Argentine Peso vs US$ exchange values with particular interest in official vs. street (blue) reference prices.}
spec.description = 'Desc: ' + spec.summary

spec.required_ruby_version = '>= 1.9.3'
spec.required_ruby_version = '>= 2'
spec.required_rubygems_version = '>= 1.8.25'

spec.license = 'MIT'
Expand All @@ -24,19 +24,19 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})

spec.add_runtime_dependency 'configatron', '~> 3.1', '>= 3.1.3'
spec.add_runtime_dependency 'nokogiri', '~> 1.6', '>= 1.6.1'
spec.add_runtime_dependency 'configatron', '~> 3.2', '>= 3.2.0'
spec.add_runtime_dependency 'nokogiri', '~> 1.6', '>= 1.6.2'

if RUBY_ENGINE == 'rbx'
spec.add_runtime_dependency 'rubysl'
spec.add_runtime_dependency 'racc' # Solves https://github.com/rubinius/rubinius/issues/2632#issuecomment-26954565
end

spec.add_development_dependency 'bundler', '~> 1.6', '>= 1.6.2'
spec.add_development_dependency 'rake', '~> 10.3', '>= 10.3.1'
spec.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.1'
spec.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.0'
spec.add_development_dependency 'webmock', '~> 1.17', '>= 1.17.4'
spec.add_development_dependency 'bundler', '~> 1.10', '>= 1.10.4'
spec.add_development_dependency 'rake', '~> 10.4', '>= 10.4.2'
spec.add_development_dependency 'rspec', '~> 3.3', '>= 3.3.0'
spec.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.3'
spec.add_development_dependency 'webmock', '~> 1.21', '>= 1.21.0'
spec.add_development_dependency 'rubygems-tasks', '~> 0.2', '>= 0.2.4'

end

0 comments on commit 8ae9333

Please sign in to comment.