yahoofx 0.1.1 → 0.1.2

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.
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ script:
5
+ - bundle exec rake test
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :test do
4
+ gem "webmock", "~> 1.9.0"
5
+ gem "rake"
6
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,16 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ addressable (2.3.2)
5
+ crack (0.3.1)
6
+ rake (0.9.2.2)
7
+ webmock (1.9.0)
8
+ addressable (>= 2.2.7)
9
+ crack (>= 0.1.7)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ rake
16
+ webmock (~> 1.9.0)
data/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## Foreign exchange (forex) rate scraper
4
4
 
5
+ [![Build
6
+ Status](https://travis-ci.org/lau/yahoofx.png)](https://travis-ci.org/lau/yahoofx) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/lau/yahoofx)
7
+
5
8
  Gets foreign currency exchange rates from Yahoo Finance.
6
9
 
7
10
  ### Installation
@@ -22,7 +22,7 @@ module Yahoofx
22
22
 
23
23
  # Example parameter: "100 EUR in USD"
24
24
  def parse(input_string)
25
- /([\d]+)[\p{Space}]*(.*)in(.*)/ =~ input_string
25
+ /([\d\.]+)[\p{Space}]*(.*)in(.*)/ =~ input_string
26
26
  { :from_amount => $1.to_f,
27
27
  :from_currency => $2.strip,
28
28
  :to_currency => $3.strip }
@@ -25,5 +25,9 @@ describe Yahoofx::Converter do
25
25
  it "should show currency rate when two valid currency codes are provided" do
26
26
  assert_equal 7.4556, @converter.answer("EURDKK").to_f
27
27
  end
28
+
29
+ it "should work with decimal in amount" do
30
+ assert_equal 11.92896, @converter.answer("1.6EUR in DKK").to_f
31
+ end
28
32
  end
29
33
  end
data/yahoofx.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'yahoofx'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.2'
4
4
  s.executables << 'yahoofx'
5
5
  s.summary = "Gets currency rates from Yahoo Finance"
6
6
  s.description = "The gem scrapes Yahoo Finance and returns foreign exchange rates. Also comes with a shell command."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahoofx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-14 00:00:00.000000000 Z
12
+ date: 2013-02-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: webmock
@@ -36,6 +36,9 @@ extensions: []
36
36
  extra_rdoc_files: []
37
37
  files:
38
38
  - .gitignore
39
+ - .travis.yml
40
+ - Gemfile
41
+ - Gemfile.lock
39
42
  - README.md
40
43
  - Rakefile
41
44
  - bin/yahoofx