shopify-money 0.14.7 → 0.14.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +34 -0
- data/README.md +1 -1
- data/lib/money/money.rb +1 -1
- data/lib/money/version.rb +1 -1
- data/money.gemspec +1 -1
- data/spec/money_spec.rb +6 -0
- metadata +5 -5
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 186250af5f49f67f218ce8b30f47cd6c20ff762f9fdb2813ca9ffe1d12a7700d
|
4
|
+
data.tar.gz: 1e6ce179c120a2781dc0be48ee0377c4179e6dc07c8fd6306689947a0847daf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d2076a57d0b364a782ce10ffe8961e8ca57b535b8c12ba006887a92336902694ecf1a9b34538632bdad51ea3bbbf2e44aa15988344a406d16890168c72823a8
|
7
|
+
data.tar.gz: 8b539f90a996544a93fbb733dbde048460a4a5069e1efef6e44b63ae8e790dd6f90a407b7e4ae0fbbb2d850864b5015204ec8a4663b2d45673589611e16ce02b
|
@@ -0,0 +1,34 @@
|
|
1
|
+
name: tests
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
ruby: ['2.6', '2.7', '3.0']
|
13
|
+
|
14
|
+
name: Ruby ${{ matrix.ruby }}
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@v2
|
17
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: ${{ matrix.ruby }}
|
21
|
+
- uses: actions/cache@v1
|
22
|
+
with:
|
23
|
+
path: vendor/bundle
|
24
|
+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
25
|
+
restore-keys: |
|
26
|
+
${{ runner.os }}-gems-
|
27
|
+
- name: Install dependencies
|
28
|
+
run: |
|
29
|
+
gem install bundler
|
30
|
+
bundle config path vendor/bundle
|
31
|
+
bundle install --jobs 4 --retry 3
|
32
|
+
- name: Run tests
|
33
|
+
run: |
|
34
|
+
bundle exec rake
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# money
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![tests](https://github.com/Shopify/money/workflows/tests/badge.svg)](https://github.com/Shopify/money/actions?query=workflow%3Atests+branch%3Amaster)
|
4
4
|
|
5
5
|
|
6
6
|
money_column expects a DECIMAL(21,3) database field.
|
data/lib/money/money.rb
CHANGED
@@ -93,7 +93,7 @@ class Money
|
|
93
93
|
def initialize(value, currency)
|
94
94
|
raise ArgumentError if value.nan?
|
95
95
|
@currency = Helpers.value_to_currency(currency)
|
96
|
-
@value = value.round(@currency.minor_units)
|
96
|
+
@value = BigDecimal(value.round(@currency.minor_units))
|
97
97
|
freeze
|
98
98
|
end
|
99
99
|
|
data/lib/money/version.rb
CHANGED
data/money.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
s.metadata['allowed_push_host'] = "https://rubygems.org"
|
17
17
|
|
18
|
-
s.add_development_dependency("bundler"
|
18
|
+
s.add_development_dependency("bundler")
|
19
19
|
s.add_development_dependency("simplecov", ">= 0")
|
20
20
|
s.add_development_dependency("rails", "~> 6.0")
|
21
21
|
s.add_development_dependency("rspec", "~> 3.2")
|
data/spec/money_spec.rb
CHANGED
@@ -963,4 +963,10 @@ RSpec.describe "Money" do
|
|
963
963
|
expect(money.currency.iso_code).to eq('EUR')
|
964
964
|
end
|
965
965
|
end
|
966
|
+
|
967
|
+
describe '#to_yaml' do
|
968
|
+
it 'returns a yaml representation' do
|
969
|
+
expect(Money.new(100, 'JPY').to_yaml).to eq("--- !ruby/object:Money\nvalue: '100.0'\ncurrency: JPY\n")
|
970
|
+
end
|
971
|
+
end
|
966
972
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify-money
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
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: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: simplecov
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,9 +103,9 @@ extra_rdoc_files: []
|
|
103
103
|
files:
|
104
104
|
- ".document"
|
105
105
|
- ".github/probots.yml"
|
106
|
+
- ".github/workflows/tests.yml"
|
106
107
|
- ".gitignore"
|
107
108
|
- ".rspec"
|
108
|
-
- ".travis.yml"
|
109
109
|
- Gemfile
|
110
110
|
- LICENSE.txt
|
111
111
|
- README.md
|
data/.travis.yml
DELETED