shopify-money 3.1.1 → 3.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a7f2b9021ba467f633adc6c9de99a2506450e64a559e80216b3ec9f4aa0d8b8
4
- data.tar.gz: 7065a07189dabcefbe4493e9246057c16da5184e63ff152eb63964c7e292f6f0
3
+ metadata.gz: 03fea29a7733cd7ac14493fff381a197b42a16de9369c8a15b0bba9905f7a8a0
4
+ data.tar.gz: '025213910adf2f5090dfb7afaa85f715f05515094e15f14c25b5805eaef569eb'
5
5
  SHA512:
6
- metadata.gz: 0b0ccd3b682176447b01ffe0513710fb490621eb9abae6078ea88464012320f766972c7dc71f02dc733fdd9e593199e9f2f594e1155f1e1aa03e5fc9ce9352b3
7
- data.tar.gz: c92da07d7d83e040ac283b1bf62031077506616ddc6e78dd901472977b5df984db521c135cc550d84aa0902a9d972d2a8c450a9a55ee552e653a3904dc2ac135
6
+ metadata.gz: dad64b959edcde085fc92904dd442babdc33122c7b2c30b91e204e597fd38e547ccf62c3e6881d78d1a2b2005581d27dcad1177b1d64ae066d2bfbafabe89cb5
7
+ data.tar.gz: 2047c647afe7e4a9b373997184bde9c1a84e47e410571531266fc60075a99da1a65ec4de685c6e79fd852e7de61af427a40440e317ad8a13014a8cc4ccd4f372
@@ -9,7 +9,7 @@ jobs:
9
9
 
10
10
  strategy:
11
11
  matrix:
12
- ruby: ['3.1', '3.2', '3.3']
12
+ ruby: ['3.1', '3.2', '3.3', '3.4']
13
13
 
14
14
  name: Ruby ${{ matrix.ruby }}
15
15
  steps:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.5
1
+ 3.4.2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-money (3.1.1)
4
+ shopify-money (3.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -295,4 +295,4 @@ DEPENDENCIES
295
295
  sqlite3
296
296
 
297
297
  BUNDLED WITH
298
- 2.5.3
298
+ 2.6.7
data/lib/money/helpers.rb CHANGED
@@ -12,6 +12,7 @@ class Money
12
12
  STRIPE_SUBUNIT_OVERRIDE = {
13
13
  'ISK' => 100,
14
14
  'UGX' => 100,
15
+ 'USDC' => 1_000_000,
15
16
  }.freeze
16
17
 
17
18
  def value_to_decimal(num)
data/lib/money/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Money
4
- VERSION = "3.1.1"
4
+ VERSION = "3.1.2"
5
5
  end
data/spec/money_spec.rb CHANGED
@@ -457,6 +457,12 @@ RSpec.describe "Money" do
457
457
  expect(Money.from_subunits(100, 'UGX', format: :stripe)).to eq(Money.new(1, 'UGX'))
458
458
  end
459
459
 
460
+ it 'overrides the subunit_to_unit amount for USDC' do
461
+ configure(experimental_crypto_currencies: true) do
462
+ expect(Money.from_subunits(500000, "USDC", format: :stripe)).to eq(Money.new(0.50, 'USDC'))
463
+ end
464
+ end
465
+
460
466
  it 'fallbacks to the default subunit_to_unit amount if no override is specified' do
461
467
  expect(Money.from_subunits(100, 'USD', format: :stripe)).to eq(Money.new(1, 'USD'))
462
468
  end
@@ -48,6 +48,12 @@ RSpec.describe "Money::Splitter" do
48
48
  expect(moneys[2].value).to eq(33)
49
49
  end
50
50
 
51
+ specify "#spit results behaves like an array" do
52
+ moneys = Money.new(100, 'JPY').split(3)
53
+ expect(moneys.size).to eq(3)
54
+ expect(moneys[3]).to eq(nil)
55
+ end
56
+
51
57
  specify "#split return respond to #first" do
52
58
  expect(Money.new(100).split(3).first).to eq(Money.new(33.34))
53
59
  expect(Money.new(100).split(3).first(2)).to eq([Money.new(33.34), Money.new(33.33)])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify Inc