money-open-exchange-rates 1.0.1 → 1.0.2

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
  SHA256:
3
- metadata.gz: 9409fd168f31d0335f71e0713e1a014ff3d23ae9abe908d6a78b1d13d05b579f
4
- data.tar.gz: e49b7cecf6992a5a5a08d4998ce5f060dd7dd0d286bbca34dbade198669f12ce
3
+ metadata.gz: ca0a9252d989a1593a4dc9af24c8789f17eb9ec15cc2e0bfa09b2d44c719e8b1
4
+ data.tar.gz: d45842e216378fb1dd04d477b1c203482f955d9607397eb570c0612606211ce8
5
5
  SHA512:
6
- metadata.gz: 5450e1dcb1f9e856d21efa06f02200bbf606b0299727a3c844f44e0709ae5efae2172128420eaaf8dec956793e589bdfb34a7103ba78708a25c24c2c112888c8
7
- data.tar.gz: 5728bf847be03d84e0c2191cf4f9da05ba2c6b2219aacb11a55f957f14dd207b751258e99518c7a164b8ae91f10f951d9f2566807de4b2e61c8874cd0d03aea2
6
+ metadata.gz: c69afba4a53c236836ea72c27e4e095c48cc09fb95584e14f9912e6e7c0de43fedf03204e1a62a56558d054b83bc32b18ddc1cbbff8a2672917765e9774d136a
7
+ data.tar.gz: 97fc884e5e97ab688d7d6480a88540e5a308c1d838b85ad0c19c63c41b6f73230f92b000ed09daa618727a4bd2a22e714b1006966339545013d956da749e6b50
data/History.md CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ v1.0.2 / 2018-03-27
3
+ ===================
4
+
5
+ * Merge pull request #46 from @cedricpim / fix-float-big-decimal-casting
6
+ * Fix issue with Float casting for BigDecimal
7
+
2
8
  v1.0.1 / 2018-03-25
3
9
  ===================
4
10
 
@@ -326,7 +326,7 @@ class Money
326
326
  from_base_rate = get_rate_or_calc_inverse(source, from_currency, opts)
327
327
  to_base_rate = get_rate_or_calc_inverse(source, to_currency, opts)
328
328
  if to_base_rate && from_base_rate
329
- rate = BigDecimal(to_base_rate) / from_base_rate
329
+ rate = BigDecimal(to_base_rate.to_s) / from_base_rate
330
330
  add_rate(from_currency, to_currency, rate)
331
331
  return rate
332
332
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Module for version constant
4
4
  module OpenExchangeRatesBank
5
- VERSION = '1.0.1'.freeze
5
+ VERSION = '1.0.2'.freeze
6
6
  end
@@ -63,6 +63,11 @@ describe Money::Bank::OpenExchangeRatesBank do
63
63
  subject.exchange_with(money, 'BMD').must_equal Money.new(50, 'BMD')
64
64
  end
65
65
 
66
+ it 'should be able to handle non integer rates' do
67
+ money = Money.new(100, 'BBD')
68
+ subject.exchange_with(money, 'TJS').must_equal Money.new(250, 'TJS')
69
+ end
70
+
66
71
  it "should raise if it can't find an exchange rate" do
67
72
  money = Money.new(0, 'USD')
68
73
  proc { subject.exchange_with(money, 'SSP') }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: money-open-exchange-rates
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Arnoud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-25 00:00:00.000000000 Z
11
+ date: 2018-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: money