latinum 1.4.0 → 1.4.1
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.
- checksums.yaml +5 -5
- data/.travis.yml +11 -5
- data/latinum.gemspec +1 -1
- data/lib/latinum/collection.rb +1 -1
- data/lib/latinum/version.rb +1 -1
- data/spec/latinum/collection_spec.rb +3 -3
- data/spec/latinum/formatters_spec.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8f722a58ca6239cee932bac966ca510c4c04e863f20f4d46f003c2d523755c8a
|
4
|
+
data.tar.gz: 05a0a502f56ef79ae947b2f1780a6a7268c623709c1839036dfa17a3e29d0971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4e199ad91783ff445ea357a24873d9e4fd37c3c54cdbef4ad24cd12bc801d6505fadea717834b0b0d698049f279331b4f01b5a3acbb3d88aa47f0e3189e593c
|
7
|
+
data.tar.gz: 8230e834c0d1106967daa0b8d40082f0bb5a5e4e85798f03f33b2941ec9ab720d55213f4a0827f38f2fdda3b95bbff8860b2328dc23369f2c5afbdc3c059e2c6
|
data/.travis.yml
CHANGED
@@ -1,12 +1,18 @@
|
|
1
1
|
language: ruby
|
2
2
|
sudo: false
|
3
|
+
|
3
4
|
rvm:
|
4
|
-
- 2.1
|
5
|
-
- 2.2
|
6
|
-
- 2.3
|
5
|
+
- 2.1
|
6
|
+
- 2.2
|
7
|
+
- 2.3
|
8
|
+
- 2.4
|
9
|
+
- 2.5
|
10
|
+
- 2.6
|
7
11
|
- ruby-head
|
8
|
-
- rbx-
|
12
|
+
- rbx-3
|
13
|
+
|
9
14
|
env: COVERAGE=true
|
15
|
+
|
10
16
|
matrix:
|
11
17
|
allow_failures:
|
12
|
-
- rvm:
|
18
|
+
- rvm: rbx-3
|
data/latinum.gemspec
CHANGED
@@ -18,6 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_development_dependency "bundler", "~> 1.3"
|
21
|
-
spec.add_development_dependency "rspec", "~> 3.4
|
21
|
+
spec.add_development_dependency "rspec", "~> 3.4"
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
end
|
data/lib/latinum/collection.rb
CHANGED
@@ -29,7 +29,7 @@ module Latinum
|
|
29
29
|
# Initialize the collection with a given set of resource names.
|
30
30
|
def initialize(names = Set.new)
|
31
31
|
@names = names
|
32
|
-
@resources = Hash.new {|hash, key| @names << key; BigDecimal
|
32
|
+
@resources = Hash.new {|hash, key| @names << key; BigDecimal("0")}
|
33
33
|
end
|
34
34
|
|
35
35
|
# All resource names which have been added to the collection, e.g. `['NZD', 'USD']`.
|
data/lib/latinum/version.rb
CHANGED
@@ -25,17 +25,17 @@ require 'set'
|
|
25
25
|
|
26
26
|
RSpec.describe Latinum::Collection do
|
27
27
|
it "can set an initial value" do
|
28
|
-
subject["NZD"] = BigDecimal
|
28
|
+
subject["NZD"] = BigDecimal("20")
|
29
29
|
|
30
30
|
expect(subject["NZD"]).to be == Latinum::Resource.load("20 NZD")
|
31
31
|
end
|
32
32
|
|
33
33
|
it "can be negated" do
|
34
|
-
subject["NZD"] = BigDecimal
|
34
|
+
subject["NZD"] = BigDecimal("20")
|
35
35
|
|
36
36
|
negated = -subject
|
37
37
|
|
38
|
-
expect(negated["NZD"]).to be == BigDecimal
|
38
|
+
expect(negated["NZD"]).to be == BigDecimal("-20")
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should sum up currencies correctly" do
|
@@ -23,7 +23,7 @@ require 'latinum/currencies/global'
|
|
23
23
|
require 'latinum/formatters'
|
24
24
|
|
25
25
|
RSpec.describe Latinum::Formatters::PlainFormatter.new(name: "NZD") do
|
26
|
-
let(:amount) {BigDecimal
|
26
|
+
let(:amount) {BigDecimal(10)}
|
27
27
|
|
28
28
|
it "can convert to integral" do
|
29
29
|
expect(subject.to_integral(amount)).to be == 10
|
@@ -71,7 +71,7 @@ RSpec.describe Latinum::Formatters::DecimalCurrencyFormatter do
|
|
71
71
|
end
|
72
72
|
|
73
73
|
context "negative zero" do
|
74
|
-
let(:resource) {Latinum::Resource.new(BigDecimal
|
74
|
+
let(:resource) {Latinum::Resource.new(BigDecimal("-0"), "NZD")}
|
75
75
|
|
76
76
|
it "should format as (positve) zero" do
|
77
77
|
expect(@bank.format(resource)).to be == "$0.00 NZD"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: latinum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.4
|
33
|
+
version: '3.4'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.4
|
40
|
+
version: '3.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.6
|
102
|
+
rubygems_version: 2.7.6
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Latinum is a simple gem for managing resource computations, including money
|