simple_currency 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +8 -0
- data/.bundle/config +3 -0
- data/.document +5 -0
- data/.gitignore +22 -0
- data/.rspec +2 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +87 -0
- data/LICENSE +20 -0
- data/README.rdoc +52 -0
- data/Rakefile +38 -0
- data/VERSION +1 -0
- data/autotest/discover.rb +1 -0
- data/lib/core_ext/numeric.rb +3 -0
- data/lib/simple_currency/currency_convertible.rb +84 -0
- data/lib/simple_currency.rb +2 -0
- data/simple_currency.gemspec +77 -0
- data/spec/simple_currency_spec.rb +70 -0
- data/spec/spec_helper.rb +9 -0
- metadata +168 -0
data/.autotest
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
Autotest.add_hook(:initialize) {|at|
|
2
|
+
at.add_exception %r{^\.git} # ignore Version Control System
|
3
|
+
at.add_exception %r{^./tmp} # ignore temp files, lest autotest will run again, and again...
|
4
|
+
at.clear_mappings # take out the default (test/test*rb)
|
5
|
+
at.add_mapping(%r{^lib/.*\.rb$}) {|f, _|
|
6
|
+
Dir['spec/**/*.rb']
|
7
|
+
}
|
8
|
+
}
|
data/.bundle/config
ADDED
data/.document
ADDED
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
abstract (1.0.0)
|
5
|
+
actionmailer (3.0.0)
|
6
|
+
actionpack (= 3.0.0)
|
7
|
+
mail (~> 2.2.5)
|
8
|
+
actionpack (3.0.0)
|
9
|
+
activemodel (= 3.0.0)
|
10
|
+
activesupport (= 3.0.0)
|
11
|
+
builder (~> 2.1.2)
|
12
|
+
erubis (~> 2.6.6)
|
13
|
+
i18n (~> 0.4.1)
|
14
|
+
rack (~> 1.2.1)
|
15
|
+
rack-mount (~> 0.6.12)
|
16
|
+
rack-test (~> 0.5.4)
|
17
|
+
tzinfo (~> 0.3.23)
|
18
|
+
activemodel (3.0.0)
|
19
|
+
activesupport (= 3.0.0)
|
20
|
+
builder (~> 2.1.2)
|
21
|
+
i18n (~> 0.4.1)
|
22
|
+
activerecord (3.0.0)
|
23
|
+
activemodel (= 3.0.0)
|
24
|
+
activesupport (= 3.0.0)
|
25
|
+
arel (~> 1.0.0)
|
26
|
+
tzinfo (~> 0.3.23)
|
27
|
+
activeresource (3.0.0)
|
28
|
+
activemodel (= 3.0.0)
|
29
|
+
activesupport (= 3.0.0)
|
30
|
+
activesupport (3.0.0)
|
31
|
+
arel (1.0.1)
|
32
|
+
activesupport (~> 3.0.0)
|
33
|
+
builder (2.1.2)
|
34
|
+
diff-lcs (1.1.2)
|
35
|
+
erubis (2.6.6)
|
36
|
+
abstract (>= 1.0.0)
|
37
|
+
fakeweb (1.3.0)
|
38
|
+
i18n (0.4.1)
|
39
|
+
json (1.4.6)
|
40
|
+
json (1.4.6-java)
|
41
|
+
mail (2.2.5)
|
42
|
+
activesupport (>= 2.3.6)
|
43
|
+
mime-types
|
44
|
+
treetop (>= 1.4.5)
|
45
|
+
mime-types (1.16)
|
46
|
+
polyglot (0.3.1)
|
47
|
+
rack (1.2.1)
|
48
|
+
rack-mount (0.6.12)
|
49
|
+
rack (>= 1.0.0)
|
50
|
+
rack-test (0.5.4)
|
51
|
+
rack (>= 1.0)
|
52
|
+
rails (3.0.0)
|
53
|
+
actionmailer (= 3.0.0)
|
54
|
+
actionpack (= 3.0.0)
|
55
|
+
activerecord (= 3.0.0)
|
56
|
+
activeresource (= 3.0.0)
|
57
|
+
activesupport (= 3.0.0)
|
58
|
+
bundler (~> 1.0.0)
|
59
|
+
railties (= 3.0.0)
|
60
|
+
railties (3.0.0)
|
61
|
+
actionpack (= 3.0.0)
|
62
|
+
activesupport (= 3.0.0)
|
63
|
+
rake (>= 0.8.4)
|
64
|
+
thor (~> 0.14.0)
|
65
|
+
rake (0.8.7)
|
66
|
+
rspec (2.0.0.beta.20)
|
67
|
+
rspec-core (= 2.0.0.beta.20)
|
68
|
+
rspec-expectations (= 2.0.0.beta.20)
|
69
|
+
rspec-mocks (= 2.0.0.beta.20)
|
70
|
+
rspec-core (2.0.0.beta.20)
|
71
|
+
rspec-expectations (2.0.0.beta.20)
|
72
|
+
diff-lcs (>= 1.1.2)
|
73
|
+
rspec-mocks (2.0.0.beta.20)
|
74
|
+
thor (0.14.0)
|
75
|
+
treetop (1.4.8)
|
76
|
+
polyglot (>= 0.3.1)
|
77
|
+
tzinfo (0.3.23)
|
78
|
+
|
79
|
+
PLATFORMS
|
80
|
+
java
|
81
|
+
ruby
|
82
|
+
|
83
|
+
DEPENDENCIES
|
84
|
+
fakeweb
|
85
|
+
json
|
86
|
+
rails
|
87
|
+
rspec (>= 2.0.0.beta.20)
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Codegram
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
= simple_currency
|
2
|
+
|
3
|
+
A really simple currency converter using Xurrency API.
|
4
|
+
Compatible with Ruby 1.8, 1.9 and JRuby.
|
5
|
+
|
6
|
+
== Installation
|
7
|
+
|
8
|
+
=== Rails 3
|
9
|
+
|
10
|
+
In your Gemfile:
|
11
|
+
|
12
|
+
gem "simple_currency"
|
13
|
+
|
14
|
+
=== Not using Rails?
|
15
|
+
|
16
|
+
Then you have to manually install the gem:
|
17
|
+
|
18
|
+
gem install simple_currency
|
19
|
+
|
20
|
+
And manually require it as well:
|
21
|
+
|
22
|
+
require "simple_currency"
|
23
|
+
|
24
|
+
== Usage
|
25
|
+
|
26
|
+
Now all your numeric stuff gets this fancy DSL for free:
|
27
|
+
|
28
|
+
30.eur.to_usd
|
29
|
+
# => 38.08
|
30
|
+
|
31
|
+
150.eur.to_usd
|
32
|
+
# => 190.4
|
33
|
+
# This one doesn't even hit Xurrency API,
|
34
|
+
# it takes advantage of Rails cache!
|
35
|
+
|
36
|
+
70.usd.to_chf
|
37
|
+
# => 71.9
|
38
|
+
|
39
|
+
== Note on Patches/Pull Requests
|
40
|
+
|
41
|
+
* Fork the project.
|
42
|
+
* Make your feature addition or bug fix.
|
43
|
+
* Add specs for it. This is important so I don't break it in a
|
44
|
+
future version unintentionally.
|
45
|
+
* Commit, do not mess with rakefile, version, or history.
|
46
|
+
If you want to have your own version, that is fine but bump version
|
47
|
+
in a commit by itself I can ignore when I pull.
|
48
|
+
* Send me a pull request. Bonus points for topic branches.
|
49
|
+
|
50
|
+
== Copyright
|
51
|
+
|
52
|
+
Copyright (c) 2010 Codegram. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rake'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'jeweler'
|
7
|
+
Jeweler::Tasks.new do |gem|
|
8
|
+
gem.name = "simple_currency"
|
9
|
+
gem.summary = "A really simple currency converter using the Xurrency API."
|
10
|
+
gem.description = "A really simple currency converter using the Xurrency API. It's Ruby 1.8, 1.9 and JRuby compatible, and it also takes advantage of Rails cache when available."
|
11
|
+
gem.email = "info@codegram.com"
|
12
|
+
gem.homepage = "http://github.com/codegram/simple_currency"
|
13
|
+
gem.authors = ["Oriol Gual", "Josep M. Bach", "Josep Jaume Rey"]
|
14
|
+
|
15
|
+
gem.add_dependency 'json', ">= 1.4.3"
|
16
|
+
|
17
|
+
gem.add_development_dependency "jeweler", '>= 1.4.0'
|
18
|
+
gem.add_development_dependency "rspec", '>= 2.0.0.beta.20'
|
19
|
+
gem.add_development_dependency "fakeweb", '>= 1.3.0'
|
20
|
+
gem.add_development_dependency "rails", '>= 3.0.0'
|
21
|
+
gem.add_development_dependency "bundler", '>= 1.0.0'
|
22
|
+
end
|
23
|
+
Jeweler::GemcutterTasks.new
|
24
|
+
rescue LoadError
|
25
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
26
|
+
end
|
27
|
+
|
28
|
+
# Rake RSpec2 task stuff
|
29
|
+
gem 'rspec', '>= 2.0.0.beta.20'
|
30
|
+
gem 'rspec-expectations'
|
31
|
+
|
32
|
+
require 'rspec/core/rake_task'
|
33
|
+
|
34
|
+
desc "Run the specs under spec"
|
35
|
+
RSpec::Core::RakeTask.new do |t|
|
36
|
+
end
|
37
|
+
|
38
|
+
task :default => :spec
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
@@ -0,0 +1 @@
|
|
1
|
+
Autotest.add_discovery { "rspec2" }
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
require 'timeout'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module CurrencyConvertible
|
6
|
+
|
7
|
+
def method_missing(method, *args, &block)
|
8
|
+
return _from(method.to_s) if method.to_s.length == 3 # Presumably a currency ("eur", "gbp"...)
|
9
|
+
|
10
|
+
# Now capture methods like to_eur, to_gbp, to_usd...
|
11
|
+
if @original && !(method.to_s =~ /^to_(utc|int|str|ary)/) && method.to_s =~/^to_/ && method.to_s.length == 6
|
12
|
+
return _to(method.to_s.gsub('to_',''))
|
13
|
+
end
|
14
|
+
|
15
|
+
super(method,*args,&block)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def _from(currency)
|
21
|
+
@original = currency
|
22
|
+
self
|
23
|
+
end
|
24
|
+
|
25
|
+
def _to(target)
|
26
|
+
raise unless @original # Must be called after a _from have set the @original currency
|
27
|
+
|
28
|
+
original = @original
|
29
|
+
amount = self
|
30
|
+
|
31
|
+
# Check if there's a cached exchange rate for today
|
32
|
+
if defined?(Rails) && cached_amount = check_cache(original, target, amount)
|
33
|
+
return cached_amount
|
34
|
+
end
|
35
|
+
|
36
|
+
# If not, perform a call to the api
|
37
|
+
json_response = call_api(original, target, amount)
|
38
|
+
return nil unless json_response
|
39
|
+
result = sprintf("%.2f", JSON.parse(json_response)["result"]["value"]).to_f
|
40
|
+
|
41
|
+
# Cache exchange rate for today only
|
42
|
+
Rails.cache.write("#{original}_#{target}_#{Time.now.to_a[3..5].join('-')}", calculate_rate(amount,result)) if defined?(Rails)
|
43
|
+
|
44
|
+
# Cache the _from method for faster reuse
|
45
|
+
self.class.send(:define_method, original.to_sym) do
|
46
|
+
_from(original)
|
47
|
+
end unless self.respond_to?(original.to_sym)
|
48
|
+
|
49
|
+
# Cache the _to method for faster reuse
|
50
|
+
self.class.send(:define_method, :"to_#{target}") do
|
51
|
+
_to(target)
|
52
|
+
end unless self.respond_to?(:"to_#{target}")
|
53
|
+
|
54
|
+
result
|
55
|
+
end
|
56
|
+
|
57
|
+
def check_cache(original, target, amount)
|
58
|
+
if rate = ::Rails.cache.read("#{original}_#{target}_#{Time.now.to_a[3..5].join('-')}")
|
59
|
+
result = (amount * rate).to_f
|
60
|
+
return result = (result * 100).round.to_f / 100
|
61
|
+
end
|
62
|
+
nil
|
63
|
+
end
|
64
|
+
|
65
|
+
def call_api(original, target, amount)
|
66
|
+
api_url = "http://xurrency.com/api/#{[original, target, amount].join('/')}"
|
67
|
+
uri = URI.parse(api_url)
|
68
|
+
|
69
|
+
retries = 10
|
70
|
+
begin
|
71
|
+
Timeout::timeout(1){
|
72
|
+
uri.open.read || nil # Returns the raw response
|
73
|
+
}
|
74
|
+
rescue Timeout::Error
|
75
|
+
retries -= 1
|
76
|
+
retries > 0 ? sleep(0.42) && retry : raise
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def calculate_rate(amount,result)
|
81
|
+
(result / amount).to_f
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{simple_currency}
|
8
|
+
s.version = "1.0.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Oriol Gual", "Josep M. Bach", "Josep Jaume Rey"]
|
12
|
+
s.date = %q{2010-08-30}
|
13
|
+
s.description = %q{A really simple currency converter using the Xurrency API. It's Ruby 1.8, 1.9 and JRuby compatible, and it also takes advantage of Rails cache when available.}
|
14
|
+
s.email = %q{info@codegram.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".autotest",
|
21
|
+
".bundle/config",
|
22
|
+
".document",
|
23
|
+
".gitignore",
|
24
|
+
".rspec",
|
25
|
+
"Gemfile",
|
26
|
+
"Gemfile.lock",
|
27
|
+
"LICENSE",
|
28
|
+
"README.rdoc",
|
29
|
+
"Rakefile",
|
30
|
+
"VERSION",
|
31
|
+
"autotest/discover.rb",
|
32
|
+
"lib/core_ext/numeric.rb",
|
33
|
+
"lib/simple_currency.rb",
|
34
|
+
"lib/simple_currency/currency_convertible.rb",
|
35
|
+
"simple_currency.gemspec",
|
36
|
+
"spec/simple_currency_spec.rb",
|
37
|
+
"spec/spec_helper.rb"
|
38
|
+
]
|
39
|
+
s.homepage = %q{http://github.com/codegram/simple_currency}
|
40
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
41
|
+
s.require_paths = ["lib"]
|
42
|
+
s.rubygems_version = %q{1.3.6}
|
43
|
+
s.summary = %q{A really simple currency converter using the Xurrency API.}
|
44
|
+
s.test_files = [
|
45
|
+
"spec/simple_currency_spec.rb",
|
46
|
+
"spec/spec_helper.rb"
|
47
|
+
]
|
48
|
+
|
49
|
+
if s.respond_to? :specification_version then
|
50
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
51
|
+
s.specification_version = 3
|
52
|
+
|
53
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
54
|
+
s.add_runtime_dependency(%q<json>, [">= 1.4.3"])
|
55
|
+
s.add_development_dependency(%q<jeweler>, [">= 1.4.0"])
|
56
|
+
s.add_development_dependency(%q<rspec>, [">= 2.0.0.beta.20"])
|
57
|
+
s.add_development_dependency(%q<fakeweb>, [">= 1.3.0"])
|
58
|
+
s.add_development_dependency(%q<rails>, [">= 3.0.0"])
|
59
|
+
s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
|
60
|
+
else
|
61
|
+
s.add_dependency(%q<json>, [">= 1.4.3"])
|
62
|
+
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
63
|
+
s.add_dependency(%q<rspec>, [">= 2.0.0.beta.20"])
|
64
|
+
s.add_dependency(%q<fakeweb>, [">= 1.3.0"])
|
65
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
66
|
+
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
67
|
+
end
|
68
|
+
else
|
69
|
+
s.add_dependency(%q<json>, [">= 1.4.3"])
|
70
|
+
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
71
|
+
s.add_dependency(%q<rspec>, [">= 2.0.0.beta.20"])
|
72
|
+
s.add_dependency(%q<fakeweb>, [">= 1.3.0"])
|
73
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
74
|
+
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "SimpleCurrency" do
|
4
|
+
|
5
|
+
def mock_uri(from_currency, to_currency, amount, result)
|
6
|
+
args = [from_currency, to_currency, amount]
|
7
|
+
response = "{\"result\":{\"value\":#{result},\"target\":\"#{to_currency}\",\"base\":\"#{from_currency}\"},\"status\":\"ok\"}"
|
8
|
+
FakeWeb.register_uri(:get, "http://xurrency.com/api/#{args.join('/')}", :body => response)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "enhances instances of Numeric with currency methods" do
|
12
|
+
expect { 30.eur && 30.usd && 30.gbp }.to_not raise_error
|
13
|
+
end
|
14
|
+
|
15
|
+
it "returns a converted amount from one currency to another" do
|
16
|
+
mock_uri('eur', 'usd', 2, 1.542)
|
17
|
+
2.eur.to_usd.should == 1.54
|
18
|
+
|
19
|
+
mock_uri('gbp', 'chf', 2, 3.4874)
|
20
|
+
2.gbp.to_chf.should == 3.49
|
21
|
+
end
|
22
|
+
|
23
|
+
it "caches methods for faster reuse" do
|
24
|
+
mock_uri('usd', 'eur', 1, 1.5)
|
25
|
+
|
26
|
+
1.usd.to_eur.should == 1.5
|
27
|
+
|
28
|
+
8.should respond_to(:usd)
|
29
|
+
8.should respond_to(:to_eur)
|
30
|
+
end
|
31
|
+
|
32
|
+
context "when Rails is present" do
|
33
|
+
|
34
|
+
before(:all) do
|
35
|
+
require 'rails'
|
36
|
+
end
|
37
|
+
|
38
|
+
it "caches the exchange rate" do
|
39
|
+
|
40
|
+
Rails.stub_chain("cache.write").and_return(true)
|
41
|
+
Rails.stub_chain("cache.read").and_return(1.5)
|
42
|
+
|
43
|
+
mock_uri('usd', 'eur', 1, 1.5)
|
44
|
+
1.usd.to_eur.should == 1.5
|
45
|
+
|
46
|
+
URI.should_not_receive(:parse)
|
47
|
+
2.usd.to_eur.should == 3
|
48
|
+
end
|
49
|
+
|
50
|
+
it "ensures the cache is valid only for today" do
|
51
|
+
now = Time.parse('2010-08-30')
|
52
|
+
|
53
|
+
Rails.stub_chain("cache.write").and_return(true)
|
54
|
+
Rails.stub_chain("cache.read").with('usd_eur_30-8-2010').and_return(1.5)
|
55
|
+
|
56
|
+
mock_uri('usd', 'eur', 1, 1.5)
|
57
|
+
1.usd.to_eur.should == 1.5
|
58
|
+
|
59
|
+
Time.stub(:now).and_return(now + 86400) # Tomorrow
|
60
|
+
Rails.stub_chain("cache.read").with('usd_eur_31-8-2010').and_return(nil)
|
61
|
+
|
62
|
+
# Exchange rate has changed next day, so forget cache rate!
|
63
|
+
mock_uri('usd', 'eur', 2, 4)
|
64
|
+
2.usd.to_eur.should == 4
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: simple_currency
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
version: 1.0.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Oriol Gual
|
13
|
+
- Josep M. Bach
|
14
|
+
- Josep Jaume Rey
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2010-08-30 00:00:00 +02:00
|
20
|
+
default_executable:
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
23
|
+
name: json
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 4
|
32
|
+
- 3
|
33
|
+
version: 1.4.3
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: jeweler
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 1
|
45
|
+
- 4
|
46
|
+
- 0
|
47
|
+
version: 1.4.0
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: rspec
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
segments:
|
58
|
+
- 2
|
59
|
+
- 0
|
60
|
+
- 0
|
61
|
+
- beta
|
62
|
+
- 20
|
63
|
+
version: 2.0.0.beta.20
|
64
|
+
type: :development
|
65
|
+
version_requirements: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: fakeweb
|
68
|
+
prerelease: false
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
segments:
|
74
|
+
- 1
|
75
|
+
- 3
|
76
|
+
- 0
|
77
|
+
version: 1.3.0
|
78
|
+
type: :development
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rails
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
segments:
|
88
|
+
- 3
|
89
|
+
- 0
|
90
|
+
- 0
|
91
|
+
version: 3.0.0
|
92
|
+
type: :development
|
93
|
+
version_requirements: *id005
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: bundler
|
96
|
+
prerelease: false
|
97
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
segments:
|
102
|
+
- 1
|
103
|
+
- 0
|
104
|
+
- 0
|
105
|
+
version: 1.0.0
|
106
|
+
type: :development
|
107
|
+
version_requirements: *id006
|
108
|
+
description: A really simple currency converter using the Xurrency API. It's Ruby 1.8, 1.9 and JRuby compatible, and it also takes advantage of Rails cache when available.
|
109
|
+
email: info@codegram.com
|
110
|
+
executables: []
|
111
|
+
|
112
|
+
extensions: []
|
113
|
+
|
114
|
+
extra_rdoc_files:
|
115
|
+
- LICENSE
|
116
|
+
- README.rdoc
|
117
|
+
files:
|
118
|
+
- .autotest
|
119
|
+
- .bundle/config
|
120
|
+
- .document
|
121
|
+
- .gitignore
|
122
|
+
- .rspec
|
123
|
+
- Gemfile
|
124
|
+
- Gemfile.lock
|
125
|
+
- LICENSE
|
126
|
+
- README.rdoc
|
127
|
+
- Rakefile
|
128
|
+
- VERSION
|
129
|
+
- autotest/discover.rb
|
130
|
+
- lib/core_ext/numeric.rb
|
131
|
+
- lib/simple_currency.rb
|
132
|
+
- lib/simple_currency/currency_convertible.rb
|
133
|
+
- simple_currency.gemspec
|
134
|
+
- spec/simple_currency_spec.rb
|
135
|
+
- spec/spec_helper.rb
|
136
|
+
has_rdoc: true
|
137
|
+
homepage: http://github.com/codegram/simple_currency
|
138
|
+
licenses: []
|
139
|
+
|
140
|
+
post_install_message:
|
141
|
+
rdoc_options:
|
142
|
+
- --charset=UTF-8
|
143
|
+
require_paths:
|
144
|
+
- lib
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
segments:
|
150
|
+
- 0
|
151
|
+
version: "0"
|
152
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
segments:
|
157
|
+
- 0
|
158
|
+
version: "0"
|
159
|
+
requirements: []
|
160
|
+
|
161
|
+
rubyforge_project:
|
162
|
+
rubygems_version: 1.3.6
|
163
|
+
signing_key:
|
164
|
+
specification_version: 3
|
165
|
+
summary: A really simple currency converter using the Xurrency API.
|
166
|
+
test_files:
|
167
|
+
- spec/simple_currency_spec.rb
|
168
|
+
- spec/spec_helper.rb
|