after_commit_everywhere 1.2.2 → 1.3.1
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 +4 -4
- data/CHANGELOG.md +33 -0
- data/README.md +69 -2
- data/after_commit_everywhere.gemspec +3 -1
- data/lib/after_commit_everywhere/version.rb +1 -1
- data/lib/after_commit_everywhere.rb +21 -1
- metadata +30 -23
- data/.github/workflows/release.yml +0 -82
- data/.github/workflows/test.yml +0 -57
- data/.gitignore +0 -12
- data/.rspec +0 -3
- data/.rubocop.yml +0 -61
- data/Appraisals +0 -48
- data/Gemfile +0 -8
- data/Gemfile.lock +0 -228
- data/Rakefile +0 -8
- data/bin/console +0 -11
- data/bin/setup +0 -8
- data/gemfiles/.bundle/config +0 -2
- data/gemfiles/activerecord_4_2.gemfile +0 -8
- data/gemfiles/activerecord_5_0.gemfile +0 -8
- data/gemfiles/activerecord_5_1.gemfile +0 -8
- data/gemfiles/activerecord_5_2.gemfile +0 -8
- data/gemfiles/activerecord_6_0.gemfile +0 -8
- data/gemfiles/activerecord_6_1.gemfile +0 -9
- data/gemfiles/activerecord_7_0.gemfile +0 -9
- data/gemfiles/activerecord_master.gemfile +0 -13
- data/tmp/.keep +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b63aab224d26cf40ba71632ebc055bd458bd3c72c87234715d1d8020f661247
|
4
|
+
data.tar.gz: b558770a87644ee346a8361419ea9d0e616062da4873427d260dc8e428d545b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99d19cdc3ba272ad5a7c6a47b232d2cd6d5fa012889cd270763d154cf559d2b504b34ba650917a8618f073897a46e4e4fec79293092d05e66aa435d21179037a
|
7
|
+
data.tar.gz: 7169e814084435d36a231cc5b2a3c7b11268a3e24913826b00fefe87ceaddea2c2299208616938d51ee245eca60136a654f8ec02664e30c3466f59b43f82f62d
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,38 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 1.3.1 (2023-06-21)
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
|
11
|
+
- Don't include development-related files into packaged gem to avoid confusing users or software tools. [@Envek][].
|
12
|
+
|
13
|
+
See discussion at [#26](https://github.com/Envek/after_commit_everywhere/issues/26).
|
14
|
+
|
15
|
+
Files packaged after this change:
|
16
|
+
|
17
|
+
CHANGELOG.md
|
18
|
+
LICENSE.txt
|
19
|
+
README.md
|
20
|
+
after_commit_everywhere.gemspec
|
21
|
+
lib/after_commit_everywhere.rb
|
22
|
+
lib/after_commit_everywhere/version.rb
|
23
|
+
lib/after_commit_everywhere/wrap.rb
|
24
|
+
|
25
|
+
## 1.3.0 (2022-10-28)
|
26
|
+
|
27
|
+
### Added
|
28
|
+
|
29
|
+
- `in_transaction` helper method to execute code within existing transaction or start a new one if there is no tx open.
|
30
|
+
|
31
|
+
It is similar to `ActiveRecord::Base.transaction`, but it doesn't swallow `ActiveRecord::Rollback` exception in case when there is no transaction open.
|
32
|
+
|
33
|
+
See discussion at [#23](https://github.com/Envek/after_commit_everywhere/pull/23) for details.
|
34
|
+
|
35
|
+
[Pull request #23](https://github.com/Envek/after_commit_everywhere/pull/23) by [@jpcamara][].
|
36
|
+
|
37
|
+
- Ability to call `in_transaction` helper with the same arguments as [`ActiveRecord::Base.transaction`](https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html#method-i-transaction). [@Envek][].
|
38
|
+
|
7
39
|
## 1.2.2 (2022-06-20)
|
8
40
|
|
9
41
|
### Fixed
|
@@ -99,3 +131,4 @@ See [#11](https://github.com/Envek/after_commit_everywhere/issues/11) for discus
|
|
99
131
|
[@joevandyk]: https://github.com/joevandyk "Joe Van Dyk"
|
100
132
|
[@stokarenko]: https://github.com/stokarenko "Sergey Tokarenko"
|
101
133
|
[@lolripgg]: https://github.com/lolripgg "James Brewer"
|
134
|
+
[@jpcamara]: https://github.com/jpcamara "JP Camara"
|
data/README.md
CHANGED
@@ -111,13 +111,80 @@ Will be executed right after transaction in which it have been declared was roll
|
|
111
111
|
|
112
112
|
If called outside transaction will raise an exception!
|
113
113
|
|
114
|
-
Please keep in mind ActiveRecord's [limitations for rolling back nested transactions](http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html#module-ActiveRecord::Transactions::ClassMethods-label-Nested+transactions).
|
114
|
+
Please keep in mind ActiveRecord's [limitations for rolling back nested transactions](http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html#module-ActiveRecord::Transactions::ClassMethods-label-Nested+transactions). See [`in_transaction`](#in_transaction) for a workaround to this limitation.
|
115
115
|
|
116
116
|
### Available helper methods
|
117
117
|
|
118
|
+
#### `in_transaction`
|
119
|
+
|
120
|
+
Makes sure the provided block is running in a transaction.
|
121
|
+
|
122
|
+
This method aims to provide clearer intention than a typical `ActiveRecord::Base.transaction` block - `in_transaction` only cares that _some_ transaction is present, not that a transaction is nested in any way.
|
123
|
+
|
124
|
+
If a transaction is present, it will yield without taking any action. Note that this means `ActiveRecord::Rollback` errors will not be trapped by `in_transaction` but will propagate up to the nearest parent transaction block.
|
125
|
+
|
126
|
+
If no transaction is present, the provided block will open a new transaction.
|
127
|
+
|
128
|
+
```rb
|
129
|
+
class ServiceObjectBtw
|
130
|
+
include AfterCommitEverywhere
|
131
|
+
|
132
|
+
def call
|
133
|
+
in_transaction do
|
134
|
+
an_update
|
135
|
+
another_update
|
136
|
+
after_commit { puts "We're all done!" }
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
```
|
141
|
+
|
142
|
+
Our service object can run its database operations safely when run in isolation.
|
143
|
+
|
144
|
+
```rb
|
145
|
+
ServiceObjectBtw.new.call # This opens a new #transaction block
|
146
|
+
```
|
147
|
+
|
148
|
+
If it is later called from code already wrapped in a transaction, the existing transaction will be utilized without any nesting:
|
149
|
+
|
150
|
+
```rb
|
151
|
+
ActiveRecord::Base.transaction do
|
152
|
+
new_update
|
153
|
+
next_update
|
154
|
+
# This no longer opens a new #transaction block, because one is already present
|
155
|
+
ServiceObjectBtw.new.call
|
156
|
+
end
|
157
|
+
```
|
158
|
+
|
159
|
+
This can be called directly on the module as well:
|
160
|
+
|
161
|
+
```rb
|
162
|
+
AfterCommitEverywhere.in_transaction do
|
163
|
+
AfterCommitEverywhere.after_commit { puts "We're all done!" }
|
164
|
+
end
|
165
|
+
```
|
166
|
+
|
118
167
|
#### `in_transaction?`
|
119
168
|
|
120
|
-
Returns `true` when called inside open transaction, `false` otherwise.
|
169
|
+
Returns `true` when called inside an open transaction, `false` otherwise.
|
170
|
+
|
171
|
+
```rb
|
172
|
+
def check_for_transaction
|
173
|
+
if in_transaction?
|
174
|
+
puts "We're in a transaction!"
|
175
|
+
else
|
176
|
+
puts "We're not in a transaction..."
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
check_for_transaction
|
181
|
+
# => prints "We're not in a transaction..."
|
182
|
+
|
183
|
+
in_transaction do
|
184
|
+
check_for_transaction
|
185
|
+
end
|
186
|
+
# => prints "We're in a transaction!"
|
187
|
+
```
|
121
188
|
|
122
189
|
### Available callback options
|
123
190
|
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.license = "MIT"
|
23
23
|
|
24
24
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
25
|
-
f.match(%r{^(
|
25
|
+
f.match(%r{^(\.|gemfiles/|bin/|spec/|tmp/|Appraisals|Gemfile|Rakefile)})
|
26
26
|
end
|
27
27
|
spec.bindir = "exe"
|
28
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
@@ -34,10 +34,12 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_development_dependency "bundler", "~> 2.0"
|
35
35
|
spec.add_development_dependency "isolator", "~> 0.7"
|
36
36
|
spec.add_development_dependency "pry"
|
37
|
+
spec.add_development_dependency "pry-byebug"
|
37
38
|
spec.add_development_dependency "rails"
|
38
39
|
spec.add_development_dependency "rake", "~> 13.0"
|
39
40
|
spec.add_development_dependency "rspec", "~> 3.0"
|
40
41
|
spec.add_development_dependency "rspec-rails"
|
41
42
|
spec.add_development_dependency "rubocop", "~> 0.81.0"
|
42
43
|
spec.add_development_dependency "sqlite3", "~> 1.3", ">= 1.3.6"
|
44
|
+
spec.add_development_dependency "yard"
|
43
45
|
end
|
@@ -14,7 +14,7 @@ module AfterCommitEverywhere
|
|
14
14
|
class NotInTransaction < RuntimeError; end
|
15
15
|
|
16
16
|
delegate :after_commit, :before_commit, :after_rollback, to: AfterCommitEverywhere
|
17
|
-
delegate :in_transaction?, to: AfterCommitEverywhere
|
17
|
+
delegate :in_transaction?, :in_transaction, to: AfterCommitEverywhere
|
18
18
|
|
19
19
|
# Causes {before_commit} and {after_commit} to raise an exception when
|
20
20
|
# called outside a transaction.
|
@@ -132,6 +132,26 @@ module AfterCommitEverywhere
|
|
132
132
|
connection.transaction_open? && connection.current_transaction.joinable?
|
133
133
|
end
|
134
134
|
|
135
|
+
# Makes sure the provided block runs in a transaction. If we are not currently in a transaction, a new transaction is started.
|
136
|
+
#
|
137
|
+
# It mimics the ActiveRecord's +transaction+ method's API and actually uses it under the hood.
|
138
|
+
#
|
139
|
+
# However, the main difference is that it doesn't swallow +ActiveRecord::Rollback+ exception in case when there is no transaction open.
|
140
|
+
#
|
141
|
+
# @see https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html#method-i-transaction
|
142
|
+
#
|
143
|
+
# @param connection [ActiveRecord::ConnectionAdapters::AbstractAdapter] Database connection to operate in. Defaults to +ActiveRecord::Base.connection+
|
144
|
+
# @param requires_new [Boolean] Forces creation of new subtransaction (savepoint) even if transaction is already opened.
|
145
|
+
# @param new_tx_options [Hash<Symbol, void>] Options to be passed to +connection.transaction+ on new transaction creation
|
146
|
+
# @return void
|
147
|
+
def in_transaction(connection = default_connection, requires_new: false, **new_tx_options)
|
148
|
+
if in_transaction?(connection) && !requires_new
|
149
|
+
yield
|
150
|
+
else
|
151
|
+
connection.transaction(requires_new: requires_new, **new_tx_options) { yield }
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
135
155
|
private
|
136
156
|
|
137
157
|
def default_connection
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: after_commit_everywhere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Novikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry-byebug
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rails
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,6 +198,20 @@ dependencies:
|
|
184
198
|
- - ">="
|
185
199
|
- !ruby/object:Gem::Version
|
186
200
|
version: 1.3.6
|
201
|
+
- !ruby/object:Gem::Dependency
|
202
|
+
name: yard
|
203
|
+
requirement: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - ">="
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
208
|
+
type: :development
|
209
|
+
prerelease: false
|
210
|
+
version_requirements: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
187
215
|
description: Brings before_commit, after_commit, and after_rollback transactional
|
188
216
|
callbacks outside of your ActiveRecord models.
|
189
217
|
email:
|
@@ -192,34 +220,13 @@ executables: []
|
|
192
220
|
extensions: []
|
193
221
|
extra_rdoc_files: []
|
194
222
|
files:
|
195
|
-
- ".github/workflows/release.yml"
|
196
|
-
- ".github/workflows/test.yml"
|
197
|
-
- ".gitignore"
|
198
|
-
- ".rspec"
|
199
|
-
- ".rubocop.yml"
|
200
|
-
- Appraisals
|
201
223
|
- CHANGELOG.md
|
202
|
-
- Gemfile
|
203
|
-
- Gemfile.lock
|
204
224
|
- LICENSE.txt
|
205
225
|
- README.md
|
206
|
-
- Rakefile
|
207
226
|
- after_commit_everywhere.gemspec
|
208
|
-
- bin/console
|
209
|
-
- bin/setup
|
210
|
-
- gemfiles/.bundle/config
|
211
|
-
- gemfiles/activerecord_4_2.gemfile
|
212
|
-
- gemfiles/activerecord_5_0.gemfile
|
213
|
-
- gemfiles/activerecord_5_1.gemfile
|
214
|
-
- gemfiles/activerecord_5_2.gemfile
|
215
|
-
- gemfiles/activerecord_6_0.gemfile
|
216
|
-
- gemfiles/activerecord_6_1.gemfile
|
217
|
-
- gemfiles/activerecord_7_0.gemfile
|
218
|
-
- gemfiles/activerecord_master.gemfile
|
219
227
|
- lib/after_commit_everywhere.rb
|
220
228
|
- lib/after_commit_everywhere/version.rb
|
221
229
|
- lib/after_commit_everywhere/wrap.rb
|
222
|
-
- tmp/.keep
|
223
230
|
homepage: https://github.com/Envek/after_commit_everywhere
|
224
231
|
licenses:
|
225
232
|
- MIT
|
@@ -1,82 +0,0 @@
|
|
1
|
-
name: Build and release gem
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags:
|
6
|
-
- v*
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
release:
|
10
|
-
runs-on: ubuntu-latest
|
11
|
-
steps:
|
12
|
-
- uses: actions/checkout@v2
|
13
|
-
with:
|
14
|
-
fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290
|
15
|
-
- uses: ruby/setup-ruby@v1
|
16
|
-
with:
|
17
|
-
ruby-version: 2.7
|
18
|
-
- name: "Extract data from tag: version, message, body"
|
19
|
-
id: tag
|
20
|
-
run: |
|
21
|
-
git fetch --tags --force # Really fetch annotated tag. See https://github.com/actions/checkout/issues/290#issuecomment-680260080
|
22
|
-
echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
|
23
|
-
echo ::set-output name=subject::$(git for-each-ref $GITHUB_REF --format='%(contents:subject)')
|
24
|
-
BODY="$(git for-each-ref $GITHUB_REF --format='%(contents:body)')"
|
25
|
-
# Extract changelog entries between this and previous version headers
|
26
|
-
escaped_version=$(echo ${GITHUB_REF#refs/tags/v} | sed -e 's/[]\/$*.^[]/\\&/g')
|
27
|
-
changelog=$(awk "BEGIN{inrelease=0} /## ${escaped_version}/{inrelease=1;next} /## [0-9]+\.[0-9]+\.[0-9]+/{inrelease=0;exit} {if (inrelease) print}" CHANGELOG.md)
|
28
|
-
# Multiline body for release. See https://github.community/t/set-output-truncates-multiline-strings/16852/5
|
29
|
-
BODY="${BODY}"$'\n'"${changelog}"
|
30
|
-
BODY="${BODY//'%'/'%25'}"
|
31
|
-
BODY="${BODY//$'\n'/'%0A'}"
|
32
|
-
BODY="${BODY//$'\r'/'%0D'}"
|
33
|
-
echo "::set-output name=body::$BODY"
|
34
|
-
# Add pre-release option if tag name has any suffix after vMAJOR.MINOR.PATCH
|
35
|
-
if [[ ${GITHUB_REF#refs/tags/} =~ ^v[0-9]+\.[0-9]+\.[0-9]+.+ ]]; then
|
36
|
-
echo ::set-output name=prerelease::true
|
37
|
-
fi
|
38
|
-
- name: Build gem
|
39
|
-
run: gem build
|
40
|
-
- name: Calculate checksums
|
41
|
-
run: sha256sum after_commit_everywhere-${{ steps.tag.outputs.version }}.gem > SHA256SUM
|
42
|
-
- name: Check version
|
43
|
-
run: ls -l after_commit_everywhere-${{ steps.tag.outputs.version }}.gem
|
44
|
-
- name: Create Release
|
45
|
-
id: create_release
|
46
|
-
uses: actions/create-release@v1
|
47
|
-
env:
|
48
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
49
|
-
with:
|
50
|
-
tag_name: ${{ github.ref }}
|
51
|
-
release_name: ${{ steps.tag.outputs.subject }}
|
52
|
-
body: ${{ steps.tag.outputs.body }}
|
53
|
-
draft: false
|
54
|
-
prerelease: ${{ steps.tag.outputs.prerelease }}
|
55
|
-
- name: Upload built gem as release asset
|
56
|
-
uses: actions/upload-release-asset@v1
|
57
|
-
env:
|
58
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
59
|
-
with:
|
60
|
-
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
61
|
-
asset_path: after_commit_everywhere-${{ steps.tag.outputs.version }}.gem
|
62
|
-
asset_name: after_commit_everywhere-${{ steps.tag.outputs.version }}.gem
|
63
|
-
asset_content_type: application/x-tar
|
64
|
-
- name: Upload checksums as release asset
|
65
|
-
uses: actions/upload-release-asset@v1
|
66
|
-
env:
|
67
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
68
|
-
with:
|
69
|
-
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
70
|
-
asset_path: SHA256SUM
|
71
|
-
asset_name: SHA256SUM
|
72
|
-
asset_content_type: text/plain
|
73
|
-
- name: Publish to GitHub packages
|
74
|
-
env:
|
75
|
-
GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
|
76
|
-
run: |
|
77
|
-
gem push after_commit_everywhere-${{ steps.tag.outputs.version }}.gem --host https://rubygems.pkg.github.com/${{ github.repository_owner }}
|
78
|
-
- name: Publish to RubyGems
|
79
|
-
env:
|
80
|
-
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
|
81
|
-
run: |
|
82
|
-
gem push after_commit_everywhere-${{ steps.tag.outputs.version }}.gem
|
data/.github/workflows/test.yml
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
name: Run tests
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
push:
|
6
|
-
branches:
|
7
|
-
- '**'
|
8
|
-
tags-ignore:
|
9
|
-
- 'v*'
|
10
|
-
schedule:
|
11
|
-
- cron: '42 0 1 * *' # on 1st day of every month at 00:42
|
12
|
-
|
13
|
-
jobs:
|
14
|
-
test:
|
15
|
-
name: 'ActiveRecord ${{ matrix.activerecord }} on Ruby ${{ matrix.ruby }}'
|
16
|
-
runs-on: ubuntu-latest
|
17
|
-
strategy:
|
18
|
-
fail-fast: false
|
19
|
-
matrix:
|
20
|
-
include:
|
21
|
-
- ruby: '2.6'
|
22
|
-
activerecord: '5.2'
|
23
|
-
gemfile: 'activerecord_5_2.gemfile'
|
24
|
-
- ruby: '2.7'
|
25
|
-
activerecord: '6.0'
|
26
|
-
gemfile: 'activerecord_6_0.gemfile'
|
27
|
-
- ruby: '2.7'
|
28
|
-
activerecord: '6.1'
|
29
|
-
gemfile: 'activerecord_6_1.gemfile'
|
30
|
-
- ruby: '3.0'
|
31
|
-
activerecord: '7.0'
|
32
|
-
gemfile: 'activerecord_7_0.gemfile'
|
33
|
-
- ruby: '3.1'
|
34
|
-
activerecord: 'HEAD'
|
35
|
-
gemfile: 'activerecord_master.gemfile'
|
36
|
-
container:
|
37
|
-
image: ruby:${{ matrix.ruby }}
|
38
|
-
env:
|
39
|
-
CI: true
|
40
|
-
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}
|
41
|
-
steps:
|
42
|
-
- uses: actions/checkout@v2
|
43
|
-
- uses: actions/cache@v2
|
44
|
-
with:
|
45
|
-
path: vendor/bundle
|
46
|
-
key: bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
|
47
|
-
restore-keys: |
|
48
|
-
bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
|
49
|
-
bundle-${{ matrix.ruby }}-
|
50
|
-
- name: Upgrade Bundler to 2.x (mostly for Rubies older than 2.7)
|
51
|
-
run: gem install bundler -v '~> 2.0' -v '!= 2.2.10'
|
52
|
-
- name: Bundle install
|
53
|
-
run: |
|
54
|
-
bundle config path vendor/bundle
|
55
|
-
bundle update
|
56
|
-
- name: Run RSpec
|
57
|
-
run: bundle exec rspec
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
TargetRubyVersion: 2.3
|
3
|
-
UseCache: false
|
4
|
-
DisplayCopNames: true
|
5
|
-
Exclude:
|
6
|
-
- "gemfiles/*"
|
7
|
-
|
8
|
-
Metrics/LineLength:
|
9
|
-
Max: 100
|
10
|
-
# To make it possible to copy or click on URIs in the code, we allow lines
|
11
|
-
# contaning a URI to be longer than Max.
|
12
|
-
AllowURI: true
|
13
|
-
URISchemes:
|
14
|
-
- http
|
15
|
-
- https
|
16
|
-
Enabled: true
|
17
|
-
|
18
|
-
Metrics/AbcSize:
|
19
|
-
Max: 30
|
20
|
-
|
21
|
-
Metrics/MethodLength:
|
22
|
-
Max: 25
|
23
|
-
|
24
|
-
Metrics/BlockLength:
|
25
|
-
Exclude:
|
26
|
-
- "spec/**/*.*"
|
27
|
-
- "*.gemspec"
|
28
|
-
|
29
|
-
Lint/SuppressedException:
|
30
|
-
Exclude:
|
31
|
-
- "spec/**/*.*"
|
32
|
-
|
33
|
-
Style/TrailingCommaInArguments:
|
34
|
-
Description: 'Checks for trailing comma in argument lists.'
|
35
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
|
36
|
-
Enabled: true
|
37
|
-
EnforcedStyleForMultiline: consistent_comma
|
38
|
-
|
39
|
-
Style/TrailingCommaInArrayLiteral:
|
40
|
-
Description: 'Checks for trailing comma in array literals.'
|
41
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
42
|
-
Enabled: true
|
43
|
-
EnforcedStyleForMultiline: consistent_comma
|
44
|
-
|
45
|
-
Style/TrailingCommaInHashLiteral:
|
46
|
-
Description: 'Checks for trailing comma in hash literals.'
|
47
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
48
|
-
Enabled: true
|
49
|
-
EnforcedStyleForMultiline: consistent_comma
|
50
|
-
|
51
|
-
Style/StringLiterals:
|
52
|
-
EnforcedStyle: double_quotes
|
53
|
-
|
54
|
-
Style/HashEachMethods:
|
55
|
-
Enabled: true
|
56
|
-
|
57
|
-
Style/HashTransformKeys:
|
58
|
-
Enabled: true
|
59
|
-
|
60
|
-
Style/HashTransformValues:
|
61
|
-
Enabled: true
|
data/Appraisals
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
appraise "activerecord-4-2" do
|
4
|
-
gem "activerecord", "~> 4.2.0"
|
5
|
-
gem "sqlite3", "~> 1.3.6"
|
6
|
-
end
|
7
|
-
|
8
|
-
appraise "activerecord-5-0" do
|
9
|
-
gem "activerecord", "~> 5.0.0"
|
10
|
-
gem "sqlite3", "~> 1.3.6"
|
11
|
-
end
|
12
|
-
|
13
|
-
appraise "activerecord-5-1" do
|
14
|
-
gem "activerecord", "~> 5.1.0"
|
15
|
-
gem "sqlite3", "~> 1.3", ">= 1.3.6"
|
16
|
-
end
|
17
|
-
|
18
|
-
appraise "activerecord-5-2" do
|
19
|
-
gem "activerecord", "~> 5.2.0"
|
20
|
-
gem "sqlite3", "~> 1.3", ">= 1.3.6"
|
21
|
-
end
|
22
|
-
|
23
|
-
appraise "activerecord-6-0" do
|
24
|
-
gem "activerecord", "~> 6.0.0"
|
25
|
-
gem "sqlite3", "~> 1.4"
|
26
|
-
end
|
27
|
-
|
28
|
-
appraise "activerecord-6-1" do
|
29
|
-
gem "activerecord", "~> 6.1.0"
|
30
|
-
gem "sqlite3", "~> 1.4"
|
31
|
-
gem "rspec-rails", "~> 4.0"
|
32
|
-
end
|
33
|
-
|
34
|
-
appraise "activerecord-7-0" do
|
35
|
-
gem "activerecord", "~> 7.0.0"
|
36
|
-
gem "sqlite3", "~> 1.4"
|
37
|
-
gem "rspec-rails", "~> 5.0"
|
38
|
-
end
|
39
|
-
|
40
|
-
appraise "activerecord-master" do
|
41
|
-
git "https://github.com/rails/rails.git" do
|
42
|
-
gem "rails"
|
43
|
-
gem "activerecord"
|
44
|
-
end
|
45
|
-
|
46
|
-
gem "sqlite3", "~> 1.4"
|
47
|
-
gem "rspec-rails", "~> 5.0"
|
48
|
-
end
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,228 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
after_commit_everywhere (1.2.2)
|
5
|
-
activerecord (>= 4.2)
|
6
|
-
activesupport
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
actioncable (7.0.3)
|
12
|
-
actionpack (= 7.0.3)
|
13
|
-
activesupport (= 7.0.3)
|
14
|
-
nio4r (~> 2.0)
|
15
|
-
websocket-driver (>= 0.6.1)
|
16
|
-
actionmailbox (7.0.3)
|
17
|
-
actionpack (= 7.0.3)
|
18
|
-
activejob (= 7.0.3)
|
19
|
-
activerecord (= 7.0.3)
|
20
|
-
activestorage (= 7.0.3)
|
21
|
-
activesupport (= 7.0.3)
|
22
|
-
mail (>= 2.7.1)
|
23
|
-
net-imap
|
24
|
-
net-pop
|
25
|
-
net-smtp
|
26
|
-
actionmailer (7.0.3)
|
27
|
-
actionpack (= 7.0.3)
|
28
|
-
actionview (= 7.0.3)
|
29
|
-
activejob (= 7.0.3)
|
30
|
-
activesupport (= 7.0.3)
|
31
|
-
mail (~> 2.5, >= 2.5.4)
|
32
|
-
net-imap
|
33
|
-
net-pop
|
34
|
-
net-smtp
|
35
|
-
rails-dom-testing (~> 2.0)
|
36
|
-
actionpack (7.0.3)
|
37
|
-
actionview (= 7.0.3)
|
38
|
-
activesupport (= 7.0.3)
|
39
|
-
rack (~> 2.0, >= 2.2.0)
|
40
|
-
rack-test (>= 0.6.3)
|
41
|
-
rails-dom-testing (~> 2.0)
|
42
|
-
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
43
|
-
actiontext (7.0.3)
|
44
|
-
actionpack (= 7.0.3)
|
45
|
-
activerecord (= 7.0.3)
|
46
|
-
activestorage (= 7.0.3)
|
47
|
-
activesupport (= 7.0.3)
|
48
|
-
globalid (>= 0.6.0)
|
49
|
-
nokogiri (>= 1.8.5)
|
50
|
-
actionview (7.0.3)
|
51
|
-
activesupport (= 7.0.3)
|
52
|
-
builder (~> 3.1)
|
53
|
-
erubi (~> 1.4)
|
54
|
-
rails-dom-testing (~> 2.0)
|
55
|
-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
56
|
-
activejob (7.0.3)
|
57
|
-
activesupport (= 7.0.3)
|
58
|
-
globalid (>= 0.3.6)
|
59
|
-
activemodel (7.0.3)
|
60
|
-
activesupport (= 7.0.3)
|
61
|
-
activerecord (7.0.3)
|
62
|
-
activemodel (= 7.0.3)
|
63
|
-
activesupport (= 7.0.3)
|
64
|
-
activestorage (7.0.3)
|
65
|
-
actionpack (= 7.0.3)
|
66
|
-
activejob (= 7.0.3)
|
67
|
-
activerecord (= 7.0.3)
|
68
|
-
activesupport (= 7.0.3)
|
69
|
-
marcel (~> 1.0)
|
70
|
-
mini_mime (>= 1.1.0)
|
71
|
-
activesupport (7.0.3)
|
72
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
73
|
-
i18n (>= 1.6, < 2)
|
74
|
-
minitest (>= 5.1)
|
75
|
-
tzinfo (~> 2.0)
|
76
|
-
anyway_config (2.3.0)
|
77
|
-
ruby-next-core (>= 0.14.0)
|
78
|
-
appraisal (2.4.1)
|
79
|
-
bundler
|
80
|
-
rake
|
81
|
-
thor (>= 0.14.0)
|
82
|
-
ast (2.4.2)
|
83
|
-
builder (3.2.4)
|
84
|
-
coderay (1.1.3)
|
85
|
-
concurrent-ruby (1.1.10)
|
86
|
-
crass (1.0.6)
|
87
|
-
diff-lcs (1.5.0)
|
88
|
-
digest (3.1.0)
|
89
|
-
dry-initializer (3.1.1)
|
90
|
-
erubi (1.10.0)
|
91
|
-
globalid (1.0.0)
|
92
|
-
activesupport (>= 5.0)
|
93
|
-
i18n (1.10.0)
|
94
|
-
concurrent-ruby (~> 1.0)
|
95
|
-
isolator (0.8.0)
|
96
|
-
sniffer (>= 0.3.1)
|
97
|
-
jaro_winkler (1.5.4)
|
98
|
-
loofah (2.18.0)
|
99
|
-
crass (~> 1.0.2)
|
100
|
-
nokogiri (>= 1.5.9)
|
101
|
-
mail (2.7.1)
|
102
|
-
mini_mime (>= 0.1.1)
|
103
|
-
marcel (1.0.2)
|
104
|
-
method_source (1.0.0)
|
105
|
-
mini_mime (1.1.2)
|
106
|
-
mini_portile2 (2.8.0)
|
107
|
-
minitest (5.15.0)
|
108
|
-
net-imap (0.2.3)
|
109
|
-
digest
|
110
|
-
net-protocol
|
111
|
-
strscan
|
112
|
-
net-pop (0.1.1)
|
113
|
-
digest
|
114
|
-
net-protocol
|
115
|
-
timeout
|
116
|
-
net-protocol (0.1.3)
|
117
|
-
timeout
|
118
|
-
net-smtp (0.3.1)
|
119
|
-
digest
|
120
|
-
net-protocol
|
121
|
-
timeout
|
122
|
-
nio4r (2.5.8)
|
123
|
-
nokogiri (1.13.6)
|
124
|
-
mini_portile2 (~> 2.8.0)
|
125
|
-
racc (~> 1.4)
|
126
|
-
parallel (1.22.1)
|
127
|
-
parser (3.1.2.0)
|
128
|
-
ast (~> 2.4.1)
|
129
|
-
pry (0.14.1)
|
130
|
-
coderay (~> 1.1)
|
131
|
-
method_source (~> 1.0)
|
132
|
-
racc (1.6.0)
|
133
|
-
rack (2.2.3.1)
|
134
|
-
rack-test (1.1.0)
|
135
|
-
rack (>= 1.0, < 3)
|
136
|
-
rails (7.0.3)
|
137
|
-
actioncable (= 7.0.3)
|
138
|
-
actionmailbox (= 7.0.3)
|
139
|
-
actionmailer (= 7.0.3)
|
140
|
-
actionpack (= 7.0.3)
|
141
|
-
actiontext (= 7.0.3)
|
142
|
-
actionview (= 7.0.3)
|
143
|
-
activejob (= 7.0.3)
|
144
|
-
activemodel (= 7.0.3)
|
145
|
-
activerecord (= 7.0.3)
|
146
|
-
activestorage (= 7.0.3)
|
147
|
-
activesupport (= 7.0.3)
|
148
|
-
bundler (>= 1.15.0)
|
149
|
-
railties (= 7.0.3)
|
150
|
-
rails-dom-testing (2.0.3)
|
151
|
-
activesupport (>= 4.2.0)
|
152
|
-
nokogiri (>= 1.6)
|
153
|
-
rails-html-sanitizer (1.4.3)
|
154
|
-
loofah (~> 2.3)
|
155
|
-
railties (7.0.3)
|
156
|
-
actionpack (= 7.0.3)
|
157
|
-
activesupport (= 7.0.3)
|
158
|
-
method_source
|
159
|
-
rake (>= 12.2)
|
160
|
-
thor (~> 1.0)
|
161
|
-
zeitwerk (~> 2.5)
|
162
|
-
rainbow (3.1.1)
|
163
|
-
rake (13.0.6)
|
164
|
-
rexml (3.2.5)
|
165
|
-
rspec (3.11.0)
|
166
|
-
rspec-core (~> 3.11.0)
|
167
|
-
rspec-expectations (~> 3.11.0)
|
168
|
-
rspec-mocks (~> 3.11.0)
|
169
|
-
rspec-core (3.11.0)
|
170
|
-
rspec-support (~> 3.11.0)
|
171
|
-
rspec-expectations (3.11.0)
|
172
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
173
|
-
rspec-support (~> 3.11.0)
|
174
|
-
rspec-mocks (3.11.1)
|
175
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
176
|
-
rspec-support (~> 3.11.0)
|
177
|
-
rspec-rails (5.1.2)
|
178
|
-
actionpack (>= 5.2)
|
179
|
-
activesupport (>= 5.2)
|
180
|
-
railties (>= 5.2)
|
181
|
-
rspec-core (~> 3.10)
|
182
|
-
rspec-expectations (~> 3.10)
|
183
|
-
rspec-mocks (~> 3.10)
|
184
|
-
rspec-support (~> 3.10)
|
185
|
-
rspec-support (3.11.0)
|
186
|
-
rubocop (0.81.0)
|
187
|
-
jaro_winkler (~> 1.5.1)
|
188
|
-
parallel (~> 1.10)
|
189
|
-
parser (>= 2.7.0.1)
|
190
|
-
rainbow (>= 2.2.2, < 4.0)
|
191
|
-
rexml
|
192
|
-
ruby-progressbar (~> 1.7)
|
193
|
-
unicode-display_width (>= 1.4.0, < 2.0)
|
194
|
-
ruby-next-core (0.15.1)
|
195
|
-
ruby-progressbar (1.11.0)
|
196
|
-
sniffer (0.5.0)
|
197
|
-
anyway_config (>= 1.0)
|
198
|
-
dry-initializer (~> 3)
|
199
|
-
sqlite3 (1.4.2)
|
200
|
-
strscan (3.0.3)
|
201
|
-
thor (1.2.1)
|
202
|
-
timeout (0.3.0)
|
203
|
-
tzinfo (2.0.4)
|
204
|
-
concurrent-ruby (~> 1.0)
|
205
|
-
unicode-display_width (1.8.0)
|
206
|
-
websocket-driver (0.7.5)
|
207
|
-
websocket-extensions (>= 0.1.0)
|
208
|
-
websocket-extensions (0.1.5)
|
209
|
-
zeitwerk (2.5.4)
|
210
|
-
|
211
|
-
PLATFORMS
|
212
|
-
ruby
|
213
|
-
|
214
|
-
DEPENDENCIES
|
215
|
-
after_commit_everywhere!
|
216
|
-
appraisal
|
217
|
-
bundler (~> 2.0)
|
218
|
-
isolator (~> 0.7)
|
219
|
-
pry
|
220
|
-
rails
|
221
|
-
rake (~> 13.0)
|
222
|
-
rspec (~> 3.0)
|
223
|
-
rspec-rails
|
224
|
-
rubocop (~> 0.81.0)
|
225
|
-
sqlite3 (~> 1.3, >= 1.3.6)
|
226
|
-
|
227
|
-
BUNDLED WITH
|
228
|
-
2.3.16
|
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "bundler/setup"
|
5
|
-
require "after_commit_everywhere"
|
6
|
-
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
-
|
10
|
-
require "pry"
|
11
|
-
Pry.start
|
data/bin/setup
DELETED
data/gemfiles/.bundle/config
DELETED
data/tmp/.keep
DELETED
File without changes
|