blockchain-info-exchange-rates 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8183a76d9a6365acf80de3bd86d1e0cd848dbae
4
- data.tar.gz: 7a61d851f2b14d749d16087dcd107b2a31fb3fa9
3
+ metadata.gz: 402ba7d9fd3301ad0224566b8abb74c621388a1c
4
+ data.tar.gz: f79e1469787ffe6a2477475bbb143fe1449908bb
5
5
  SHA512:
6
- metadata.gz: fda7b12a39489dfd59238eaeb8492db8fac5341f177136d9a83bf5fdcf20a3265ddf36acd41797cb052cb9c2c3c8539e886aba5dce2478b457b8f0f9c4224068
7
- data.tar.gz: b7fc3351cb3ad87375264947336ff8890020a12d5be3796a129b5dff42de29be0f76739e9327a8137bb8d4fa452766f31b11977b5f2424ab74b993ae617c6b68
6
+ metadata.gz: 15680e577fc1982b586d271edcea9abca7ec1cfd6532d2e76ab354c91ba889909ff5d4a22ab8377a9838f54a1369f8042ca03461c5c760b01055c315e203197b
7
+ data.tar.gz: 4d87b91a96a77ff5fe6f2d03bf6a9896a0a17a0739b4d018b54deeebfc8b84424c5c33e0eb676c96edc89d46e3551b07ba3aff5d1789e4cd5ceec6951b7c216d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: blockchain-info-exchange-rates 0.1.6 ruby lib
5
+ # stub: blockchain-info-exchange-rates 0.1.7 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "blockchain-info-exchange-rates"
9
- s.version = "0.1.6"
9
+ s.version = "0.1.7"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Simon Males"]
14
- s.date = "2014-10-31"
14
+ s.date = "2014-11-01"
15
15
  s.description = "This is a direct rip/port of Money Open Exchange Rates experimental and not used in production."
16
16
  s.email = "sime@sime.net.au"
17
17
  s.extra_rdoc_files = [
@@ -36,6 +36,11 @@ class Money
36
36
  raise InvalidCache
37
37
  end
38
38
 
39
+ def get_rate(from_currency, to_currency, opts = {})
40
+ expire_rates
41
+ super
42
+ end
43
+
39
44
  def expire_rates
40
45
  if ttl_in_seconds && rates_expiration <= Time.now
41
46
  update_rates
@@ -97,26 +102,4 @@ class Money
97
102
  end
98
103
  end
99
104
  end
100
- if false
101
- bie = Money::Bank::BlockchainInfoExchangeRates.new
102
- bie.cache = '/tmp/bogus.cache.json'
103
- bie.update_rates
104
-
105
- #money = Money.new(0, "USD")
106
-
107
- btc = {
108
- :priority => 1,
109
- :iso_code => "BTC",
110
- :name => "Bitcoin",
111
- :symbol => "BTC",
112
- :subunit => "Cent",
113
- :subunit_to_unit => 1000,
114
- :separator => ".",
115
- :delimiter => ","
116
- }
117
- Money::Currency.register(btc)
118
- rate = 13.7603
119
- bie.add_rate("USD", "BTC", 1 / 13.7603)
120
- bie.add_rate("BTC", "USD", rate)
121
- bie.exchange_with(100.to_money("BTC"), 'USD').cents.must_equal 137603
122
- end
105
+
@@ -220,7 +220,6 @@ describe Money::Bank::BlockchainInfoExchangeRates do
220
220
  end
221
221
 
222
222
  it 'should update the rates' do
223
- subject.update_rates
224
223
  subject.get_rate('BTC', 'EUR').wont_equal @btc_eur_rate
225
224
  end
226
225
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blockchain-info-exchange-rates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Males
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-31 00:00:00.000000000 Z
11
+ date: 2014-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: monetize