monetize 1.5.0 → 1.6.0

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: f097cc5d74682b06292fd1f13a33f02b2f7559f0
4
- data.tar.gz: fad265ffdc0fa112f1116ea78974b20c865719bf
3
+ metadata.gz: 752c49ba346a3c44c84575d7c9342729666430e8
4
+ data.tar.gz: 177308181d7d1a004ace9e3d7d1b3f341a074ac0
5
5
  SHA512:
6
- metadata.gz: 7a7bee5359f9c717b01434c2e95f7bb8a58116fd629971e04c44453a96d26e2a7a7bc1d7088873eba4628769ad2d79476bdf669199d02f19de6e51d7a211e456
7
- data.tar.gz: c831f37f346f27ad1d44e6757c7afbc2ab845380c5fa5ca9874029f9a507f208d7401c32d5de9113a8667832035fd14fdd6c6294cb5185ac4713a2c79128e5ec
6
+ metadata.gz: 1b3736c481b79a3c1faa4e3187181a862a4861567166b30b8196b9966d7828d7f3d8a279c03c69453dda14f3f4124723df03389f396b16842e5d3ebe9ee096e5
7
+ data.tar.gz: f11c8c2062a848b0d5fac52f05c8d9c86c8707f0fbb04772c83f324e906c903f347bce9072f55000c463e3757a7367fdf68d704655b3417e77329d11b28b548a
data/.travis.yml CHANGED
@@ -6,6 +6,7 @@ rvm:
6
6
  - 2.1.9
7
7
  - 2.2.5
8
8
  - 2.3.1
9
+ - 2.4.0
9
10
  - jruby-9.0.5.0
10
11
  script: bundle exec rspec spec
11
12
  notifications:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.6.0
4
+ - Ruby 2.4.0 support
5
+ - Money version updated to 6.8
6
+
3
7
  ## 1.5.0
4
8
  - Add extra currencies:
5
9
  - Azerbaijani manat
@@ -23,7 +27,6 @@
23
27
  - Suppress errors when using parse. Use `parse!` instead
24
28
  - Strip currency symbol prefix when parsing input
25
29
 
26
-
27
30
  ## 1.4.0
28
31
  - Required Forwardable on Collection to resolve NameError [\#44](https://github.com/RubyMoney/monetize/issues/44)
29
32
  - Add capability to parse currency amounts given with suffixes (K, M, B, and T)
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'coveralls', require: false
3
+ gem 'coveralls', '>= 0.8.17', require: false
4
4
 
5
5
  # JSON gem no longer supports ruby < 2.0.0
6
6
  if defined?(JRUBY_VERSION)
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Monetize
4
- VERSION = '1.5.0'
4
+ VERSION = '1.6.0'
5
5
  end
data/lib/monetize.rb CHANGED
@@ -92,6 +92,7 @@ module Monetize
92
92
  value *= currency.subunit_to_unit
93
93
  Money.new(value, currency)
94
94
  end
95
+ singleton_class.send(:alias_method, :from_integer, :from_fixnum)
95
96
 
96
97
  def self.from_float(value, currency = Money.default_currency)
97
98
  value = BigDecimal.new(value.to_s)
@@ -107,7 +108,7 @@ module Monetize
107
108
 
108
109
  def self.from_numeric(value, currency = Money.default_currency)
109
110
  case value
110
- when Fixnum
111
+ when Integer
111
112
  from_fixnum(value, currency)
112
113
  when Numeric
113
114
  value = BigDecimal.new(value.to_s)
data/monetize.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_dependency 'money', '~> 6.7'
22
+ spec.add_dependency 'money', '~> 6.8'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.3'
25
25
  spec.add_development_dependency 'rake'
@@ -232,11 +232,11 @@ describe Monetize do
232
232
  end
233
233
 
234
234
  context 'parsing an instance of Numeric class' do
235
- let(:fixnum) { 10 }
235
+ let(:integer) { 10 }
236
236
  let(:float) { 10.0 }
237
237
  let(:big_decimal) { BigDecimal.new('10') }
238
238
 
239
- [:fixnum, :float, :big_decimal].each do |type|
239
+ [:integer, :float, :big_decimal].each do |type|
240
240
  it "returns a new Money object based on the #{type} input" do
241
241
  money = Monetize.parse(send(type), 'USD')
242
242
 
@@ -386,6 +386,10 @@ describe Monetize do
386
386
  m = Monetize.from_fixnum(1, 'EUR')
387
387
  expect(m.currency).to eq Money::Currency.wrap('EUR')
388
388
  end
389
+
390
+ it 'is aliased as from_integer' do
391
+ expect(Monetize.from_integer(1)).to eq(Monetize.from_fixnum(1))
392
+ end
389
393
  end
390
394
 
391
395
  describe '.from_float' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monetize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Emmons
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-28 00:00:00.000000000 Z
11
+ date: 2017-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: money
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '6.7'
19
+ version: '6.8'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '6.7'
26
+ version: '6.8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement