cashify 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +16 -14
- data/lib/cashify/arithmetic.rb +2 -2
- data/lib/cashify/version.rb +1 -1
- data/lib/cashify.rb +4 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64931c6dfbe556f9be4e6df85acec0834356908a458b0f0a5902dd4860f255c7
|
4
|
+
data.tar.gz: b253a94f16e2963ae778fab00462f1ba7afc5b4a40e4eee5509d8eb9473ff8e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 632eb24038223a070f5745265efe091c084d68148db0fa60d884c9837a02c99bf292cd719e1abc224309d67e11fd126a63518b8476e5224fecf4a0eacde9dab3
|
7
|
+
data.tar.gz: a2c76193de484857fb7237a5ef16d9e3c479cca6ac1db3874f13223e035e1f417bc4d58baeb5fdb12d399d7e1f8c62a162c7656f32cde459a2226990671ca3c6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,42 +1,44 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cashify (0.9.
|
4
|
+
cashify (0.9.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.2)
|
10
10
|
coderay (1.1.3)
|
11
|
+
json (2.6.2)
|
11
12
|
method_source (1.0.0)
|
12
|
-
minitest (5.
|
13
|
-
parallel (1.
|
14
|
-
parser (3.
|
13
|
+
minitest (5.16.3)
|
14
|
+
parallel (1.22.1)
|
15
|
+
parser (3.1.2.1)
|
15
16
|
ast (~> 2.4.1)
|
16
17
|
pry (0.14.1)
|
17
18
|
coderay (~> 1.1)
|
18
19
|
method_source (~> 1.0)
|
19
|
-
rainbow (3.
|
20
|
+
rainbow (3.1.1)
|
20
21
|
rake (13.0.6)
|
21
|
-
regexp_parser (2.
|
22
|
+
regexp_parser (2.6.1)
|
22
23
|
rexml (3.2.5)
|
23
|
-
rubocop (1.
|
24
|
+
rubocop (1.39.0)
|
25
|
+
json (~> 2.3)
|
24
26
|
parallel (~> 1.10)
|
25
|
-
parser (>= 3.
|
27
|
+
parser (>= 3.1.2.1)
|
26
28
|
rainbow (>= 2.2.2, < 4.0)
|
27
29
|
regexp_parser (>= 1.8, < 3.0)
|
28
|
-
rexml
|
29
|
-
rubocop-ast (>= 1.
|
30
|
+
rexml (>= 3.2.5, < 4.0)
|
31
|
+
rubocop-ast (>= 1.23.0, < 2.0)
|
30
32
|
ruby-progressbar (~> 1.7)
|
31
33
|
unicode-display_width (>= 1.4.0, < 3.0)
|
32
|
-
rubocop-ast (1.
|
33
|
-
parser (>= 3.
|
34
|
-
rubocop-minitest (0.
|
34
|
+
rubocop-ast (1.23.0)
|
35
|
+
parser (>= 3.1.1.0)
|
36
|
+
rubocop-minitest (0.23.2)
|
35
37
|
rubocop (>= 0.90, < 2.0)
|
36
38
|
rubocop-rake (0.6.0)
|
37
39
|
rubocop (~> 1.0)
|
38
40
|
ruby-progressbar (1.11.0)
|
39
|
-
unicode-display_width (2.
|
41
|
+
unicode-display_width (2.3.0)
|
40
42
|
|
41
43
|
PLATFORMS
|
42
44
|
x86_64-darwin-19
|
data/lib/cashify/arithmetic.rb
CHANGED
@@ -72,12 +72,12 @@ class Cash
|
|
72
72
|
return currencies if other.zero?
|
73
73
|
return other.currencies.transform_values { |v| 0 - v } if zero?
|
74
74
|
|
75
|
-
(@currencies.keys + other.currencies.keys).uniq.
|
75
|
+
(@currencies.keys + other.currencies.keys).uniq.to_h do |k|
|
76
76
|
minuend = @currencies[k] || 0
|
77
77
|
subtrahend = other.currencies[k] || 0
|
78
78
|
|
79
79
|
[k, minuend - subtrahend]
|
80
|
-
end
|
80
|
+
end
|
81
81
|
end
|
82
82
|
end
|
83
83
|
end
|
data/lib/cashify/version.rb
CHANGED
data/lib/cashify.rb
CHANGED
@@ -69,6 +69,10 @@ class Cash
|
|
69
69
|
currencies.map { |k, v| "#{(v * 0.01).round} #{k}" }.join(", ")
|
70
70
|
end
|
71
71
|
|
72
|
+
def to_delimited_s
|
73
|
+
currencies.map { |k, v| "#{(v * 0.01).round.to_formatted_s(:delimited, delimiter: " ")} #{k}" }.join(", ")
|
74
|
+
end
|
75
|
+
|
72
76
|
def currency
|
73
77
|
currencies.keys.first
|
74
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cashify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan Halse
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Money trouble no more! Add, subtract, and have fun with money in different
|
14
14
|
currencies.
|
@@ -41,7 +41,8 @@ metadata:
|
|
41
41
|
homepage_uri: https://github.com/johanhalse/cashify
|
42
42
|
source_code_uri: https://github.com/johanhalse/cashify
|
43
43
|
changelog_uri: https://github.com/johanhalse/cashify/CHANGELOG.md
|
44
|
-
|
44
|
+
rubygems_mfa_required: 'true'
|
45
|
+
post_install_message:
|
45
46
|
rdoc_options: []
|
46
47
|
require_paths:
|
47
48
|
- lib
|
@@ -56,8 +57,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
57
|
- !ruby/object:Gem::Version
|
57
58
|
version: '0'
|
58
59
|
requirements: []
|
59
|
-
rubygems_version: 3.
|
60
|
-
signing_key:
|
60
|
+
rubygems_version: 3.3.7
|
61
|
+
signing_key:
|
61
62
|
specification_version: 4
|
62
63
|
summary: A sensible way to handle money
|
63
64
|
test_files: []
|