money_extensions 1.0.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/release.yml +59 -0
- data/.github/workflows/ruby.yml +24 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +12 -0
- data/README.md +17 -4
- data/gemfiles/{rails5.gemfile → rails60.gemfile} +2 -2
- data/gemfiles/{rails6.gemfile → rails61.gemfile} +2 -2
- data/gemfiles/rails70.gemfile +7 -0
- data/lib/money_extensions/active_record/extensions.rb +5 -5
- data/lib/money_extensions/{money_field.rb → active_record/money_field.rb} +1 -3
- data/lib/money_extensions/version.rb +1 -1
- data/lib/money_extensions.rb +1 -1
- data/money_extensions.gemspec +2 -5
- data/spec/support/coverage_loader.rb +2 -3
- metadata +13 -52
- data/.travis.yml +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b02ce974d0847bc55984f19c7b7052cac5178e8ca17ed4c17778b7cab20b918d
|
4
|
+
data.tar.gz: 888c92464c6ba7510c855ac6ee8670c802d41f6e408f2e3cbf21ae793e1fdd7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbef0196b7903684d86d191ea69dbc1f007949647f5135bbafcaea0ae6f9ee097fa46eee3892e4b9a799909345cabbb6f8b2fbe9681e994198d9e7220dd76991
|
7
|
+
data.tar.gz: 52f7c134ad23cc2db1d1d040be03abfbf7607bf48731f838004609cf114045c4efdf09f708f3ae8864ff242a38b20e5e79f1a4cfd6f8d4d73cbcd3299784b845
|
@@ -0,0 +1,59 @@
|
|
1
|
+
name: Release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- "v*"
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
build:
|
10
|
+
name: Build
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- name: Checkout
|
14
|
+
uses: actions/checkout@v2
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
bundler-cache: true
|
18
|
+
- run: bundle exec rake
|
19
|
+
|
20
|
+
release:
|
21
|
+
needs: build
|
22
|
+
name: Release
|
23
|
+
runs-on: ubuntu-latest
|
24
|
+
steps:
|
25
|
+
- name: Checkout
|
26
|
+
uses: actions/checkout@v2
|
27
|
+
|
28
|
+
- name: Generate Changelog
|
29
|
+
run: |
|
30
|
+
# Get version from github ref (remove 'refs/tags/' and prefix 'v')
|
31
|
+
version="${GITHUB_REF#refs/tags/v}"
|
32
|
+
npx changelog-parser CHANGELOG.md | jq -cr ".versions | .[] | select(.version == \"$version\") | .body" > ${{ github.workflow }}-CHANGELOG.txt
|
33
|
+
|
34
|
+
- name: Release
|
35
|
+
uses: softprops/action-gh-release@v1
|
36
|
+
with:
|
37
|
+
body_path: ${{ github.workflow }}-CHANGELOG.txt
|
38
|
+
env:
|
39
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
40
|
+
|
41
|
+
publish:
|
42
|
+
needs: [build, release]
|
43
|
+
name: Publish
|
44
|
+
runs-on: ubuntu-latest
|
45
|
+
|
46
|
+
steps:
|
47
|
+
- uses: actions/checkout@v2
|
48
|
+
- uses: ruby/setup-ruby@v1
|
49
|
+
|
50
|
+
- name: Publish to RubyGems
|
51
|
+
run: |
|
52
|
+
mkdir -p $HOME/.gem
|
53
|
+
touch $HOME/.gem/credentials
|
54
|
+
chmod 0600 $HOME/.gem/credentials
|
55
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
56
|
+
gem build *.gemspec
|
57
|
+
gem push *.gem
|
58
|
+
env:
|
59
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Build and Test
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
gemfile: [rails60, rails61, rails70]
|
9
|
+
ruby: ["2.7", "3.0", "3.1"]
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
env:
|
12
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: ${{ matrix.ruby }}
|
18
|
+
bundler-cache: true
|
19
|
+
- run: bundle exec rake
|
20
|
+
- name: Coveralls
|
21
|
+
uses: coverallsapp/github-action@master
|
22
|
+
with:
|
23
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
24
|
+
path-to-lcov: coverage/lcov.info
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.1.0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.3.0
|
4
|
+
|
5
|
+
- [PLAT-377] Improve bundler require time for the Gem
|
6
|
+
|
7
|
+
## 1.2.0
|
8
|
+
|
9
|
+
- [PLAT-183] Build with Ruby 3.1 / Rails 7 and publish coverage with github action
|
10
|
+
|
11
|
+
## 1.1.0
|
12
|
+
|
13
|
+
- [TT-8625] Update to build with github actions / ruby 3.0 / rails 6.1
|
14
|
+
|
3
15
|
## 1.0.0
|
4
16
|
|
5
17
|
* [TT-5845] Update to support money gems >= 6
|
data/README.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
Money Extensions
|
2
|
-
================
|
1
|
+
# Money Extensions
|
3
2
|
|
4
|
-
[![
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/money_extensions.svg)](http://badge.fury.io/rb/money_extensions)
|
4
|
+
[![Build Status](https://github.com/sealink/money_extensions/workflows/Build%20and%20Test/badge.svg?branch=master)](https://github.com/sealink/money_extensions/actions)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/sealink/money_extensions/badge.png)](https://coveralls.io/r/sealink/money_extensions)
|
6
|
-
[![Dependency Status](https://gemnasium.com/sealink/money_extensions.png?travis)](https://gemnasium.com/sealink/money_extensions)
|
7
6
|
[![Code Climate](https://codeclimate.com/github/sealink/money_extensions.png)](https://codeclimate.com/github/sealink/money_extensions)
|
8
7
|
|
9
8
|
# DESCRIPTION
|
@@ -11,7 +10,10 @@ Money Extensions
|
|
11
10
|
Extends the money classes with helpful functions and currency functions
|
12
11
|
|
13
12
|
e.g. in model
|
13
|
+
|
14
|
+
```ruby
|
14
15
|
money_fields :total, :discount
|
16
|
+
```
|
15
17
|
|
16
18
|
This will by default map a money object "total" to a database column total_in_cents and the same for discount.
|
17
19
|
|
@@ -24,3 +26,14 @@ See spec directory for examples.
|
|
24
26
|
Add to your Gemfile:
|
25
27
|
gem 'money_extensions'
|
26
28
|
|
29
|
+
# RELEASE
|
30
|
+
|
31
|
+
To publish a new version of this gem the following steps must be taken.
|
32
|
+
|
33
|
+
- Update the version in the following files
|
34
|
+
```
|
35
|
+
CHANGELOG.md
|
36
|
+
lib/quick_travel/version.rb
|
37
|
+
```
|
38
|
+
- Create a tag using the format v0.1.0
|
39
|
+
- Follow build progress in GitHub actions
|
@@ -2,9 +2,7 @@
|
|
2
2
|
|
3
3
|
module ActiveRecord
|
4
4
|
module Extensions
|
5
|
-
|
6
|
-
base.extend(ClassMethods)
|
7
|
-
end
|
5
|
+
extend ActiveSupport::Concern
|
8
6
|
|
9
7
|
module ClassMethods
|
10
8
|
# Assign a :currency (Money::Currency object) reader/writer for the given
|
@@ -44,5 +42,7 @@ module ActiveRecord
|
|
44
42
|
end
|
45
43
|
end
|
46
44
|
|
47
|
-
|
48
|
-
::ActiveRecord::Base.send(:include,
|
45
|
+
ActiveSupport.on_load(:active_record) do
|
46
|
+
::ActiveRecord::Base.send(:include, MoneyField)
|
47
|
+
::ActiveRecord::Base.send(:include, ActiveRecord::Extensions)
|
48
|
+
end
|
data/lib/money_extensions.rb
CHANGED
@@ -4,12 +4,12 @@ module MoneyExtensions
|
|
4
4
|
require 'money_extensions/integer'
|
5
5
|
require 'money_extensions/split_between'
|
6
6
|
require 'money_extensions/html_format'
|
7
|
-
require 'money_extensions/money_field'
|
8
7
|
require 'money_extensions/numeric'
|
9
8
|
require 'money_extensions/string'
|
10
9
|
|
11
10
|
# TODO: Defer requiring the active record extension to who needs it
|
12
11
|
if Module.const_defined?('ActiveRecord')
|
12
|
+
require 'money_extensions/active_record/money_field'
|
13
13
|
require 'money_extensions/active_record/extensions'
|
14
14
|
end
|
15
15
|
|
data/money_extensions.gemspec
CHANGED
@@ -20,16 +20,13 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_dependency 'money', '>= 6.0.0'
|
23
|
-
spec.add_dependency 'activesupport', '>=
|
23
|
+
spec.add_dependency 'activesupport', '>= 6'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'rake'
|
26
|
-
spec.add_development_dependency 'pry'
|
27
26
|
spec.add_development_dependency 'rubocop'
|
28
27
|
spec.add_development_dependency 'rspec'
|
29
28
|
spec.add_development_dependency 'coverage-kit'
|
30
|
-
spec.add_development_dependency 'simplecov-rcov'
|
31
|
-
spec.add_development_dependency 'coveralls'
|
32
29
|
spec.add_development_dependency 'sqlite3'
|
33
30
|
spec.add_development_dependency 'activerecord'
|
34
|
-
spec.add_development_dependency '
|
31
|
+
spec.add_development_dependency 'pry-byebug'
|
35
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: money_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Noack
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-07-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: money
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '6'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '6'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,20 +53,6 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: pry
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
56
|
- !ruby/object:Gem::Dependency
|
71
57
|
name: rubocop
|
72
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,34 +95,6 @@ dependencies:
|
|
109
95
|
- - ">="
|
110
96
|
- !ruby/object:Gem::Version
|
111
97
|
version: '0'
|
112
|
-
- !ruby/object:Gem::Dependency
|
113
|
-
name: simplecov-rcov
|
114
|
-
requirement: !ruby/object:Gem::Requirement
|
115
|
-
requirements:
|
116
|
-
- - ">="
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
version: '0'
|
119
|
-
type: :development
|
120
|
-
prerelease: false
|
121
|
-
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
requirements:
|
123
|
-
- - ">="
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: coveralls
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - ">="
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: '0'
|
133
|
-
type: :development
|
134
|
-
prerelease: false
|
135
|
-
version_requirements: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - ">="
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: '0'
|
140
98
|
- !ruby/object:Gem::Dependency
|
141
99
|
name: sqlite3
|
142
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,7 +124,7 @@ dependencies:
|
|
166
124
|
- !ruby/object:Gem::Version
|
167
125
|
version: '0'
|
168
126
|
- !ruby/object:Gem::Dependency
|
169
|
-
name:
|
127
|
+
name: pry-byebug
|
170
128
|
requirement: !ruby/object:Gem::Requirement
|
171
129
|
requirements:
|
172
130
|
- - ">="
|
@@ -185,23 +143,26 @@ executables: []
|
|
185
143
|
extensions: []
|
186
144
|
extra_rdoc_files: []
|
187
145
|
files:
|
146
|
+
- ".github/dependabot.yml"
|
147
|
+
- ".github/workflows/release.yml"
|
148
|
+
- ".github/workflows/ruby.yml"
|
188
149
|
- ".gitignore"
|
189
150
|
- ".rspec"
|
190
151
|
- ".ruby-version"
|
191
|
-
- ".travis.yml"
|
192
152
|
- CHANGELOG.md
|
193
153
|
- Gemfile
|
194
154
|
- LICENSE
|
195
155
|
- README.md
|
196
156
|
- Rakefile
|
197
|
-
- gemfiles/
|
198
|
-
- gemfiles/
|
157
|
+
- gemfiles/rails60.gemfile
|
158
|
+
- gemfiles/rails61.gemfile
|
159
|
+
- gemfiles/rails70.gemfile
|
199
160
|
- lib/money_extensions.rb
|
200
161
|
- lib/money_extensions/active_record/extensions.rb
|
162
|
+
- lib/money_extensions/active_record/money_field.rb
|
201
163
|
- lib/money_extensions/array.rb
|
202
164
|
- lib/money_extensions/html_format.rb
|
203
165
|
- lib/money_extensions/integer.rb
|
204
|
-
- lib/money_extensions/money_field.rb
|
205
166
|
- lib/money_extensions/numeric.rb
|
206
167
|
- lib/money_extensions/split_between.rb
|
207
168
|
- lib/money_extensions/string.rb
|
@@ -234,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
195
|
- !ruby/object:Gem::Version
|
235
196
|
version: '0'
|
236
197
|
requirements: []
|
237
|
-
rubygems_version: 3.
|
198
|
+
rubygems_version: 3.3.3
|
238
199
|
signing_key:
|
239
200
|
specification_version: 4
|
240
201
|
summary: Set of extensions to the money gem used by TravelLink Technology.
|
data/.travis.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.4
|
4
|
-
- 2.5
|
5
|
-
- 2.6
|
6
|
-
matrix:
|
7
|
-
exclude:
|
8
|
-
- rvm: 2.4
|
9
|
-
gemfile: gemfiles/rails6.gemfile
|
10
|
-
|
11
|
-
script: "bundle exec rake spec"
|
12
|
-
gemfile:
|
13
|
-
- gemfiles/rails5.gemfile
|
14
|
-
- gemfiles/rails6.gemfile
|
15
|
-
sudo: false
|
16
|
-
cache: bundler
|
17
|
-
before_install:
|
18
|
-
- gem install bundler
|