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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e845ad45cb261ed350e3baff7d3eade222009665caaaa52b033cdf66da011477
4
- data.tar.gz: 460242834342b799f8e6a1d4475bcd9e24a251240471bf8c47c9d899b346ab51
3
+ metadata.gz: 186250af5f49f67f218ce8b30f47cd6c20ff762f9fdb2813ca9ffe1d12a7700d
4
+ data.tar.gz: 1e6ce179c120a2781dc0be48ee0377c4179e6dc07c8fd6306689947a0847daf4
5
5
  SHA512:
6
- metadata.gz: 949a72b84927dfa363f433d62ebd54cdc898417cf222697eb04ab87e00d61a36321d777bb7ba01f7a500ae2f95f3b5480b4d0080245616e69424ebbe5a6700ed
7
- data.tar.gz: f3ba37b79af054aa738c1ff562eea5d2a43c9e8b3856ee8be487320a59f704cf64f560bf1186e0ebfe2b7b3b4065d638c5d218f6a1ae4efdfbc7fa4521ff057c
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
- [![Build Status](https://travis-ci.org/Shopify/money.svg?branch=master)](https://travis-ci.org/Shopify/money)
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.
@@ -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
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  class Money
3
- VERSION = "0.14.7"
3
+ VERSION = "0.14.8"
4
4
  end
@@ -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", ">= 1.5")
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")
@@ -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.7
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: 2020-11-19 00:00:00.000000000 Z
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: '1.5'
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: '1.5'
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
@@ -1,13 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- branches:
5
- only:
6
- - master
7
- rvm:
8
- - 2.7
9
- - 2.6
10
- before_install:
11
- # https://github.com/travis-ci/travis-ci/issues/8978#issuecomment-354036443
12
- - gem update --system
13
- - gem install bundler