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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d31e15d5b41014afa8408f2eb88f2951ceb129c8b1f189c0fb4783d506a9e99
4
- data.tar.gz: 3d88a0eab4b01d2dbfb4ea67cc32c26e255d677f6d71ea34b056fcaca426a3ef
3
+ metadata.gz: 64931c6dfbe556f9be4e6df85acec0834356908a458b0f0a5902dd4860f255c7
4
+ data.tar.gz: b253a94f16e2963ae778fab00462f1ba7afc5b4a40e4eee5509d8eb9473ff8e1
5
5
  SHA512:
6
- metadata.gz: 4fc2adb94912de958291b7a5aa878a89cde682aa1dad935136576e4df4a9705570b7bfc85fbeadb027e9d0478de0b269e4482fbefbbe664f0914c2d8b83247ac
7
- data.tar.gz: 8dac497d6a56923a1d7dadfe96ef64dba8e5fb7aba33b1278e392b8759b83c4ee0f6515a8c7e55c8a0ac7d948b4298cbc2e210449415bc93b19fecafc7377b14
6
+ metadata.gz: 632eb24038223a070f5745265efe091c084d68148db0fa60d884c9837a02c99bf292cd719e1abc224309d67e11fd126a63518b8476e5224fecf4a0eacde9dab3
7
+ data.tar.gz: a2c76193de484857fb7237a5ef16d9e3c479cca6ac1db3874f13223e035e1f417bc4d58baeb5fdb12d399d7e1f8c62a162c7656f32cde459a2226990671ca3c6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.9.2] - 2022-11-18
2
+
3
+ - Add `to_delimited_s` method (Johan Halse)
4
+
1
5
  ## [0.9.1] - 2021-10-08
2
6
 
3
7
  - Add `cashify` method for Active Record users (Johan Halse)
data/Gemfile.lock CHANGED
@@ -1,42 +1,44 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cashify (0.9.1)
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.14.4)
13
- parallel (1.21.0)
14
- parser (3.0.2.0)
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.0.0)
20
+ rainbow (3.1.1)
20
21
  rake (13.0.6)
21
- regexp_parser (2.1.1)
22
+ regexp_parser (2.6.1)
22
23
  rexml (3.2.5)
23
- rubocop (1.22.1)
24
+ rubocop (1.39.0)
25
+ json (~> 2.3)
24
26
  parallel (~> 1.10)
25
- parser (>= 3.0.0.0)
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.12.0, < 2.0)
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.12.0)
33
- parser (>= 3.0.1.1)
34
- rubocop-minitest (0.15.1)
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.1.0)
41
+ unicode-display_width (2.3.0)
40
42
 
41
43
  PLATFORMS
42
44
  x86_64-darwin-19
@@ -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.map do |k|
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.to_h
80
+ end
81
81
  end
82
82
  end
83
83
  end
@@ -1,3 +1,3 @@
1
1
  module Cashify
2
- VERSION = "0.9.1".freeze
2
+ VERSION = "0.9.2".freeze
3
3
  end
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.1
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: 2021-10-08 00:00:00.000000000 Z
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
- post_install_message:
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.2.22
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: []