after_commit_everywhere 0.1.5 → 1.0.0
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/.github/workflows/release.yml +82 -0
- data/.github/workflows/test.yml +63 -0
- data/Appraisals +15 -3
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +126 -119
- data/README.md +53 -3
- data/after_commit_everywhere.gemspec +2 -2
- data/gemfiles/activerecord_6_1.gemfile +9 -0
- data/gemfiles/activerecord_master.gemfile +7 -3
- data/lib/after_commit_everywhere/version.rb +1 -1
- metadata +12 -10
- data/.travis.yml +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8b2847b6af9346bd5c042b364ccc1d94bbb696d82ef118362ad8085c2a96715
|
4
|
+
data.tar.gz: b0089a18d4087f800e161477678a8dd69871d2413801e33556751a5e7d6731f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c8342d72f9a2d076d62f52842aff823cdef8a8024e23f45c3360fdb662338878258efde0e2f09fe1f471d5830ed068d723af46f3ac628ef62daea843efdc723
|
7
|
+
data.tar.gz: b6a74ddc5d7e8f34db311fd44d9b88627c2213c70931e6ebaf635f64cc74a3051724af088b4c2ba04f4420b856779626a1fbab2bc0f07c2c9c22168f5a9ff779
|
@@ -0,0 +1,82 @@
|
|
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
|
@@ -0,0 +1,63 @@
|
|
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.5'
|
22
|
+
activerecord: '4.2'
|
23
|
+
gemfile: 'activerecord_4_2.gemfile'
|
24
|
+
- ruby: '2.6'
|
25
|
+
activerecord: '5.0'
|
26
|
+
gemfile: 'activerecord_5_0.gemfile'
|
27
|
+
- ruby: '2.6'
|
28
|
+
activerecord: '5.1'
|
29
|
+
gemfile: 'activerecord_5_1.gemfile'
|
30
|
+
- ruby: '2.6'
|
31
|
+
activerecord: '5.2'
|
32
|
+
gemfile: 'activerecord_5_2.gemfile'
|
33
|
+
- ruby: '2.7'
|
34
|
+
activerecord: '6.0'
|
35
|
+
gemfile: 'activerecord_6_0.gemfile'
|
36
|
+
- ruby: '2.7'
|
37
|
+
activerecord: '6.1'
|
38
|
+
gemfile: 'activerecord_6_1.gemfile'
|
39
|
+
- ruby: '3.0'
|
40
|
+
activerecord: 'HEAD'
|
41
|
+
gemfile: 'activerecord_master.gemfile'
|
42
|
+
container:
|
43
|
+
image: ruby:${{ matrix.ruby }}
|
44
|
+
env:
|
45
|
+
CI: true
|
46
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}
|
47
|
+
steps:
|
48
|
+
- uses: actions/checkout@v2
|
49
|
+
- uses: actions/cache@v2
|
50
|
+
with:
|
51
|
+
path: vendor/bundle
|
52
|
+
key: bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
|
53
|
+
restore-keys: |
|
54
|
+
bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
|
55
|
+
bundle-${{ matrix.ruby }}-
|
56
|
+
- name: Upgrade Bundler to 2.x (mostly for Rubies older than 2.7)
|
57
|
+
run: gem install bundler -v '~> 2.0' -v '!= 2.2.10'
|
58
|
+
- name: Bundle install
|
59
|
+
run: |
|
60
|
+
bundle config path vendor/bundle
|
61
|
+
bundle update
|
62
|
+
- name: Run RSpec
|
63
|
+
run: bundle exec rspec
|
data/Appraisals
CHANGED
@@ -25,9 +25,21 @@ appraise "activerecord-6-0" do
|
|
25
25
|
gem "sqlite3", "~> 1.4"
|
26
26
|
end
|
27
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
|
+
|
28
34
|
appraise "activerecord-master" do
|
29
|
-
|
30
|
-
|
35
|
+
git "https://github.com/rails/rails.git" do
|
36
|
+
gem "rails"
|
37
|
+
gem "activerecord"
|
38
|
+
end
|
39
|
+
|
31
40
|
gem "sqlite3", "~> 1.4"
|
32
|
-
gem "rspec-rails", "~> 4.0
|
41
|
+
gem "rspec-rails", "~> 4.0"
|
42
|
+
|
43
|
+
# See https://github.com/cgriego/active_attr/pull/183
|
44
|
+
gem "active_attr", git: "https://github.com/Envek/active_attr.git", branch: "chore/loose-dependency-constraint"
|
33
45
|
end
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## 1.0.0 (2021-02-17)
|
10
|
+
|
11
|
+
Declare gem as stable. No changes since 0.1.5.
|
12
|
+
|
13
|
+
See [#11](https://github.com/Envek/after_commit_everywhere/issues/11) for discussion.
|
14
|
+
|
9
15
|
## 0.1.5 (2020-03-22)
|
10
16
|
|
11
17
|
### Fixed
|
data/Gemfile.lock
CHANGED
@@ -1,91 +1,96 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
after_commit_everywhere (0.1.
|
4
|
+
after_commit_everywhere (0.1.5)
|
5
5
|
activerecord (>= 4.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (6.
|
11
|
-
actionpack (= 6.
|
10
|
+
actioncable (6.1.2.1)
|
11
|
+
actionpack (= 6.1.2.1)
|
12
|
+
activesupport (= 6.1.2.1)
|
12
13
|
nio4r (~> 2.0)
|
13
14
|
websocket-driver (>= 0.6.1)
|
14
|
-
actionmailbox (6.
|
15
|
-
actionpack (= 6.
|
16
|
-
activejob (= 6.
|
17
|
-
activerecord (= 6.
|
18
|
-
activestorage (= 6.
|
19
|
-
activesupport (= 6.
|
15
|
+
actionmailbox (6.1.2.1)
|
16
|
+
actionpack (= 6.1.2.1)
|
17
|
+
activejob (= 6.1.2.1)
|
18
|
+
activerecord (= 6.1.2.1)
|
19
|
+
activestorage (= 6.1.2.1)
|
20
|
+
activesupport (= 6.1.2.1)
|
20
21
|
mail (>= 2.7.1)
|
21
|
-
actionmailer (6.
|
22
|
-
actionpack (= 6.
|
23
|
-
actionview (= 6.
|
24
|
-
activejob (= 6.
|
22
|
+
actionmailer (6.1.2.1)
|
23
|
+
actionpack (= 6.1.2.1)
|
24
|
+
actionview (= 6.1.2.1)
|
25
|
+
activejob (= 6.1.2.1)
|
26
|
+
activesupport (= 6.1.2.1)
|
25
27
|
mail (~> 2.5, >= 2.5.4)
|
26
28
|
rails-dom-testing (~> 2.0)
|
27
|
-
actionpack (6.
|
28
|
-
actionview (= 6.
|
29
|
-
activesupport (= 6.
|
30
|
-
rack (~> 2.0, >= 2.0.
|
29
|
+
actionpack (6.1.2.1)
|
30
|
+
actionview (= 6.1.2.1)
|
31
|
+
activesupport (= 6.1.2.1)
|
32
|
+
rack (~> 2.0, >= 2.0.9)
|
31
33
|
rack-test (>= 0.6.3)
|
32
34
|
rails-dom-testing (~> 2.0)
|
33
35
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
34
|
-
actiontext (6.
|
35
|
-
actionpack (= 6.
|
36
|
-
activerecord (= 6.
|
37
|
-
activestorage (= 6.
|
38
|
-
activesupport (= 6.
|
36
|
+
actiontext (6.1.2.1)
|
37
|
+
actionpack (= 6.1.2.1)
|
38
|
+
activerecord (= 6.1.2.1)
|
39
|
+
activestorage (= 6.1.2.1)
|
40
|
+
activesupport (= 6.1.2.1)
|
39
41
|
nokogiri (>= 1.8.5)
|
40
|
-
actionview (6.
|
41
|
-
activesupport (= 6.
|
42
|
+
actionview (6.1.2.1)
|
43
|
+
activesupport (= 6.1.2.1)
|
42
44
|
builder (~> 3.1)
|
43
45
|
erubi (~> 1.4)
|
44
46
|
rails-dom-testing (~> 2.0)
|
45
47
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
46
|
-
active_attr (0.15.
|
47
|
-
actionpack (>= 3.0.2, < 6.
|
48
|
-
activemodel (>= 3.0.2, < 6.
|
49
|
-
activesupport (>= 3.0.2, < 6.
|
50
|
-
activejob (6.
|
51
|
-
activesupport (= 6.
|
48
|
+
active_attr (0.15.1)
|
49
|
+
actionpack (>= 3.0.2, < 6.2)
|
50
|
+
activemodel (>= 3.0.2, < 6.2)
|
51
|
+
activesupport (>= 3.0.2, < 6.2)
|
52
|
+
activejob (6.1.2.1)
|
53
|
+
activesupport (= 6.1.2.1)
|
52
54
|
globalid (>= 0.3.6)
|
53
|
-
activemodel (6.
|
54
|
-
activesupport (= 6.
|
55
|
-
activerecord (6.
|
56
|
-
activemodel (= 6.
|
57
|
-
activesupport (= 6.
|
58
|
-
activestorage (6.
|
59
|
-
actionpack (= 6.
|
60
|
-
activejob (= 6.
|
61
|
-
activerecord (= 6.
|
55
|
+
activemodel (6.1.2.1)
|
56
|
+
activesupport (= 6.1.2.1)
|
57
|
+
activerecord (6.1.2.1)
|
58
|
+
activemodel (= 6.1.2.1)
|
59
|
+
activesupport (= 6.1.2.1)
|
60
|
+
activestorage (6.1.2.1)
|
61
|
+
actionpack (= 6.1.2.1)
|
62
|
+
activejob (= 6.1.2.1)
|
63
|
+
activerecord (= 6.1.2.1)
|
64
|
+
activesupport (= 6.1.2.1)
|
62
65
|
marcel (~> 0.3.1)
|
63
|
-
|
66
|
+
mimemagic (~> 0.3.2)
|
67
|
+
activesupport (6.1.2.1)
|
64
68
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
65
|
-
i18n (>=
|
66
|
-
minitest (
|
67
|
-
tzinfo (~>
|
68
|
-
zeitwerk (~> 2.
|
69
|
-
anyway_config (1.
|
70
|
-
|
69
|
+
i18n (>= 1.6, < 2)
|
70
|
+
minitest (>= 5.1)
|
71
|
+
tzinfo (~> 2.0)
|
72
|
+
zeitwerk (~> 2.3)
|
73
|
+
anyway_config (2.1.0)
|
74
|
+
ruby-next-core (>= 0.11.0)
|
75
|
+
appraisal (2.3.0)
|
71
76
|
bundler
|
72
77
|
rake
|
73
78
|
thor (>= 0.14.0)
|
74
|
-
ast (2.4.
|
79
|
+
ast (2.4.2)
|
75
80
|
builder (3.2.4)
|
76
|
-
coderay (1.1.
|
77
|
-
concurrent-ruby (1.1.
|
81
|
+
coderay (1.1.3)
|
82
|
+
concurrent-ruby (1.1.8)
|
78
83
|
crass (1.0.6)
|
79
|
-
diff-lcs (1.
|
80
|
-
erubi (1.
|
84
|
+
diff-lcs (1.4.4)
|
85
|
+
erubi (1.10.0)
|
81
86
|
globalid (0.4.2)
|
82
87
|
activesupport (>= 4.2.0)
|
83
|
-
i18n (1.8.
|
88
|
+
i18n (1.8.9)
|
84
89
|
concurrent-ruby (~> 1.0)
|
85
|
-
isolator (0.
|
90
|
+
isolator (0.7.0)
|
86
91
|
sniffer (>= 0.3.1)
|
87
92
|
jaro_winkler (1.5.4)
|
88
|
-
loofah (2.
|
93
|
+
loofah (2.9.0)
|
89
94
|
crass (~> 1.0.2)
|
90
95
|
nokogiri (>= 1.5.9)
|
91
96
|
mail (2.7.1)
|
@@ -93,101 +98,103 @@ GEM
|
|
93
98
|
marcel (0.3.3)
|
94
99
|
mimemagic (~> 0.3.2)
|
95
100
|
method_source (1.0.0)
|
96
|
-
mimemagic (0.3.
|
101
|
+
mimemagic (0.3.5)
|
97
102
|
mini_mime (1.0.2)
|
98
|
-
mini_portile2 (2.
|
99
|
-
minitest (5.14.
|
100
|
-
nio4r (2.5.
|
101
|
-
nokogiri (1.
|
102
|
-
mini_portile2 (~> 2.
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
103
|
+
mini_portile2 (2.5.0)
|
104
|
+
minitest (5.14.3)
|
105
|
+
nio4r (2.5.5)
|
106
|
+
nokogiri (1.11.1)
|
107
|
+
mini_portile2 (~> 2.5.0)
|
108
|
+
racc (~> 1.4)
|
109
|
+
parallel (1.20.1)
|
110
|
+
parser (3.0.0.0)
|
111
|
+
ast (~> 2.4.1)
|
112
|
+
pry (0.14.0)
|
107
113
|
coderay (~> 1.1)
|
108
114
|
method_source (~> 1.0)
|
109
|
-
|
115
|
+
racc (1.5.2)
|
116
|
+
rack (2.2.3)
|
110
117
|
rack-test (1.1.0)
|
111
118
|
rack (>= 1.0, < 3)
|
112
|
-
rails (6.
|
113
|
-
actioncable (= 6.
|
114
|
-
actionmailbox (= 6.
|
115
|
-
actionmailer (= 6.
|
116
|
-
actionpack (= 6.
|
117
|
-
actiontext (= 6.
|
118
|
-
actionview (= 6.
|
119
|
-
activejob (= 6.
|
120
|
-
activemodel (= 6.
|
121
|
-
activerecord (= 6.
|
122
|
-
activestorage (= 6.
|
123
|
-
activesupport (= 6.
|
124
|
-
bundler (>= 1.
|
125
|
-
railties (= 6.
|
119
|
+
rails (6.1.2.1)
|
120
|
+
actioncable (= 6.1.2.1)
|
121
|
+
actionmailbox (= 6.1.2.1)
|
122
|
+
actionmailer (= 6.1.2.1)
|
123
|
+
actionpack (= 6.1.2.1)
|
124
|
+
actiontext (= 6.1.2.1)
|
125
|
+
actionview (= 6.1.2.1)
|
126
|
+
activejob (= 6.1.2.1)
|
127
|
+
activemodel (= 6.1.2.1)
|
128
|
+
activerecord (= 6.1.2.1)
|
129
|
+
activestorage (= 6.1.2.1)
|
130
|
+
activesupport (= 6.1.2.1)
|
131
|
+
bundler (>= 1.15.0)
|
132
|
+
railties (= 6.1.2.1)
|
126
133
|
sprockets-rails (>= 2.0.0)
|
127
134
|
rails-dom-testing (2.0.3)
|
128
135
|
activesupport (>= 4.2.0)
|
129
136
|
nokogiri (>= 1.6)
|
130
137
|
rails-html-sanitizer (1.3.0)
|
131
138
|
loofah (~> 2.3)
|
132
|
-
railties (6.
|
133
|
-
actionpack (= 6.
|
134
|
-
activesupport (= 6.
|
139
|
+
railties (6.1.2.1)
|
140
|
+
actionpack (= 6.1.2.1)
|
141
|
+
activesupport (= 6.1.2.1)
|
135
142
|
method_source
|
136
143
|
rake (>= 0.8.7)
|
137
|
-
thor (
|
144
|
+
thor (~> 1.0)
|
138
145
|
rainbow (3.0.0)
|
139
|
-
rake (13.0.
|
146
|
+
rake (13.0.3)
|
140
147
|
rexml (3.2.4)
|
141
|
-
rspec (3.
|
142
|
-
rspec-core (~> 3.
|
143
|
-
rspec-expectations (~> 3.
|
144
|
-
rspec-mocks (~> 3.
|
145
|
-
rspec-core (3.
|
146
|
-
rspec-support (~> 3.
|
147
|
-
rspec-expectations (3.
|
148
|
+
rspec (3.10.0)
|
149
|
+
rspec-core (~> 3.10.0)
|
150
|
+
rspec-expectations (~> 3.10.0)
|
151
|
+
rspec-mocks (~> 3.10.0)
|
152
|
+
rspec-core (3.10.1)
|
153
|
+
rspec-support (~> 3.10.0)
|
154
|
+
rspec-expectations (3.10.1)
|
148
155
|
diff-lcs (>= 1.2.0, < 2.0)
|
149
|
-
rspec-support (~> 3.
|
150
|
-
rspec-mocks (3.
|
156
|
+
rspec-support (~> 3.10.0)
|
157
|
+
rspec-mocks (3.10.2)
|
151
158
|
diff-lcs (>= 1.2.0, < 2.0)
|
152
|
-
rspec-support (~> 3.
|
153
|
-
rspec-rails (
|
154
|
-
actionpack (>=
|
155
|
-
activesupport (>=
|
156
|
-
railties (>=
|
157
|
-
rspec-core (~> 3.
|
158
|
-
rspec-expectations (~> 3.
|
159
|
-
rspec-mocks (~> 3.
|
160
|
-
rspec-support (~> 3.
|
161
|
-
rspec-support (3.
|
162
|
-
rubocop (0.
|
159
|
+
rspec-support (~> 3.10.0)
|
160
|
+
rspec-rails (4.0.2)
|
161
|
+
actionpack (>= 4.2)
|
162
|
+
activesupport (>= 4.2)
|
163
|
+
railties (>= 4.2)
|
164
|
+
rspec-core (~> 3.10)
|
165
|
+
rspec-expectations (~> 3.10)
|
166
|
+
rspec-mocks (~> 3.10)
|
167
|
+
rspec-support (~> 3.10)
|
168
|
+
rspec-support (3.10.2)
|
169
|
+
rubocop (0.81.0)
|
163
170
|
jaro_winkler (~> 1.5.1)
|
164
171
|
parallel (~> 1.10)
|
165
172
|
parser (>= 2.7.0.1)
|
166
173
|
rainbow (>= 2.2.2, < 4.0)
|
167
174
|
rexml
|
168
175
|
ruby-progressbar (~> 1.7)
|
169
|
-
unicode-display_width (>= 1.4.0, <
|
170
|
-
ruby-
|
176
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
177
|
+
ruby-next-core (0.12.0)
|
178
|
+
ruby-progressbar (1.11.0)
|
171
179
|
sniffer (0.4.0)
|
172
180
|
active_attr (>= 0.10.2)
|
173
181
|
anyway_config (>= 1.0)
|
174
|
-
sprockets (4.0.
|
182
|
+
sprockets (4.0.2)
|
175
183
|
concurrent-ruby (~> 1.0)
|
176
184
|
rack (> 1, < 3)
|
177
|
-
sprockets-rails (3.2.
|
185
|
+
sprockets-rails (3.2.2)
|
178
186
|
actionpack (>= 4.0)
|
179
187
|
activesupport (>= 4.0)
|
180
188
|
sprockets (>= 3.0.0)
|
181
189
|
sqlite3 (1.4.2)
|
182
|
-
thor (1.0
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
websocket-driver (0.7.1)
|
190
|
+
thor (1.1.0)
|
191
|
+
tzinfo (2.0.4)
|
192
|
+
concurrent-ruby (~> 1.0)
|
193
|
+
unicode-display_width (1.7.0)
|
194
|
+
websocket-driver (0.7.3)
|
188
195
|
websocket-extensions (>= 0.1.0)
|
189
|
-
websocket-extensions (0.1.
|
190
|
-
zeitwerk (2.
|
196
|
+
websocket-extensions (0.1.5)
|
197
|
+
zeitwerk (2.4.2)
|
191
198
|
|
192
199
|
PLATFORMS
|
193
200
|
ruby
|
@@ -196,14 +203,14 @@ DEPENDENCIES
|
|
196
203
|
after_commit_everywhere!
|
197
204
|
appraisal
|
198
205
|
bundler (~> 2.0)
|
199
|
-
isolator
|
206
|
+
isolator (~> 0.7)
|
200
207
|
pry
|
201
208
|
rails
|
202
209
|
rake (~> 13.0)
|
203
210
|
rspec (~> 3.0)
|
204
211
|
rspec-rails
|
205
|
-
rubocop (~> 0.
|
212
|
+
rubocop (~> 0.81.0)
|
206
213
|
sqlite3 (~> 1.3, >= 1.3.6)
|
207
214
|
|
208
215
|
BUNDLED WITH
|
209
|
-
2.
|
216
|
+
2.2.9
|
data/README.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
[](https://rubygems.org/gems/after_commit_everywhere)
|
2
|
-
[](https://travis-ci.org/Envek/after_commit_everywhere)
|
3
2
|
|
4
3
|
# `after_commit` everywhere
|
5
4
|
|
6
|
-
Allows to use ActiveRecord transactional callbacks outside of ActiveRecord models, literally everywhere in your application.
|
5
|
+
Allows to use ActiveRecord transactional callbacks **outside** of ActiveRecord models, literally everywhere in your application.
|
7
6
|
|
8
7
|
Inspired by these articles:
|
9
8
|
|
@@ -114,12 +113,63 @@ Please keep in mind ActiveRecord's [limitations for rolling back nested transact
|
|
114
113
|
|
115
114
|
**Yes**.
|
116
115
|
|
116
|
+
### Be aware of mental traps
|
117
|
+
|
118
|
+
While it is convenient to have `after_commit` method at a class level to be able to call it from anywhere, take care not to call it on models.
|
119
|
+
|
120
|
+
So, **DO NOT DO THIS**:
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
class Post < ActiveRecord::Base
|
124
|
+
def self.bulk_ops
|
125
|
+
find_each do
|
126
|
+
after_commit { raise "Some doesn't expect that this screw up everything, but they should" }
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
```
|
131
|
+
|
132
|
+
By calling [the class level `after_commit` method on models](https://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html#method-i-after_commit), you're effectively adding callback for all `Post` instances, including **future** ones.
|
133
|
+
|
134
|
+
See https://github.com/Envek/after_commit_everywhere/issues/13 for details.
|
117
135
|
|
118
136
|
## Development
|
119
137
|
|
120
138
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
121
139
|
|
122
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
140
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
141
|
+
|
142
|
+
### Releasing new versions
|
143
|
+
|
144
|
+
1. Bump version number in `lib/after_commit_everywhere/version.rb`
|
145
|
+
|
146
|
+
In case of pre-releases keep in mind [rubygems/rubygems#3086](https://github.com/rubygems/rubygems/issues/3086) and check version with command like `Gem::Version.new(AfterCommitEverywhere::VERSION).to_s`
|
147
|
+
|
148
|
+
2. Fill `CHANGELOG.md` with missing changes, add header with version and date.
|
149
|
+
|
150
|
+
3. Make a commit:
|
151
|
+
|
152
|
+
```sh
|
153
|
+
git add lib/after_commit_everywhere/version.rb CHANGELOG.md
|
154
|
+
version=$(ruby -r ./lib/after_commit_everywhere/version.rb -e "puts Gem::Version.new(AfterCommitEverywhere::VERSION)")
|
155
|
+
git commit --message="${version}: " --edit
|
156
|
+
```
|
157
|
+
|
158
|
+
4. Create annotated tag:
|
159
|
+
|
160
|
+
```sh
|
161
|
+
git tag v${version} --annotate --message="${version}: " --edit --sign
|
162
|
+
```
|
163
|
+
|
164
|
+
5. Fill version name into subject line and (optionally) some description (list of changes will be taken from `CHANGELOG.md` and appended automatically)
|
165
|
+
|
166
|
+
6. Push it:
|
167
|
+
|
168
|
+
```sh
|
169
|
+
git push --follow-tags
|
170
|
+
```
|
171
|
+
|
172
|
+
7. GitHub Actions will create a new release, build and push gem into [rubygems.org](https://rubygems.org)! You're done!
|
123
173
|
|
124
174
|
|
125
175
|
## Contributing
|
@@ -31,12 +31,12 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_dependency "activerecord", ">= 4.2"
|
32
32
|
spec.add_development_dependency "appraisal"
|
33
33
|
spec.add_development_dependency "bundler", "~> 2.0"
|
34
|
-
spec.add_development_dependency "isolator"
|
34
|
+
spec.add_development_dependency "isolator", "~> 0.7"
|
35
35
|
spec.add_development_dependency "pry"
|
36
36
|
spec.add_development_dependency "rails"
|
37
37
|
spec.add_development_dependency "rake", "~> 13.0"
|
38
38
|
spec.add_development_dependency "rspec", "~> 3.0"
|
39
39
|
spec.add_development_dependency "rspec-rails"
|
40
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
40
|
+
spec.add_development_dependency "rubocop", "~> 0.81.0"
|
41
41
|
spec.add_development_dependency "sqlite3", "~> 1.3", ">= 1.3.6"
|
42
42
|
end
|
@@ -2,9 +2,13 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
|
6
|
-
gem "
|
5
|
+
git "https://github.com/rails/rails.git" do
|
6
|
+
gem "rails"
|
7
|
+
gem "activerecord"
|
8
|
+
end
|
9
|
+
|
7
10
|
gem "sqlite3", "~> 1.4"
|
8
|
-
gem "rspec-rails", "~> 4.0
|
11
|
+
gem "rspec-rails", "~> 4.0"
|
12
|
+
gem "active_attr", git: "https://github.com/Envek/active_attr.git", branch: "chore/loose-dependency-constraint"
|
9
13
|
|
10
14
|
gemspec path: "../"
|
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: 0.
|
4
|
+
version: 1.0.0
|
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: 2021-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: isolator
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.7'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '0.7'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 0.81.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: 0.81.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: sqlite3
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,10 +178,11 @@ executables: []
|
|
178
178
|
extensions: []
|
179
179
|
extra_rdoc_files: []
|
180
180
|
files:
|
181
|
+
- ".github/workflows/release.yml"
|
182
|
+
- ".github/workflows/test.yml"
|
181
183
|
- ".gitignore"
|
182
184
|
- ".rspec"
|
183
185
|
- ".rubocop.yml"
|
184
|
-
- ".travis.yml"
|
185
186
|
- Appraisals
|
186
187
|
- CHANGELOG.md
|
187
188
|
- Gemfile
|
@@ -198,6 +199,7 @@ files:
|
|
198
199
|
- gemfiles/activerecord_5_1.gemfile
|
199
200
|
- gemfiles/activerecord_5_2.gemfile
|
200
201
|
- gemfiles/activerecord_6_0.gemfile
|
202
|
+
- gemfiles/activerecord_6_1.gemfile
|
201
203
|
- gemfiles/activerecord_master.gemfile
|
202
204
|
- lib/after_commit_everywhere.rb
|
203
205
|
- lib/after_commit_everywhere/version.rb
|
@@ -222,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
224
|
- !ruby/object:Gem::Version
|
223
225
|
version: '0'
|
224
226
|
requirements: []
|
225
|
-
rubygems_version: 3.1.
|
227
|
+
rubygems_version: 3.1.4
|
226
228
|
signing_key:
|
227
229
|
specification_version: 4
|
228
230
|
summary: Executes code after database commit wherever you want in your application
|
data/.travis.yml
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
cache: bundler
|
2
|
-
sudo: false
|
3
|
-
language: ruby
|
4
|
-
|
5
|
-
addons:
|
6
|
-
apt:
|
7
|
-
sources:
|
8
|
-
- travis-ci/sqlite3
|
9
|
-
packages:
|
10
|
-
- sqlite3
|
11
|
-
|
12
|
-
matrix:
|
13
|
-
include:
|
14
|
-
- rvm: 2.3.8
|
15
|
-
gemfile: gemfiles/activerecord_4_2.gemfile
|
16
|
-
- rvm: 2.4.9
|
17
|
-
gemfile: gemfiles/activerecord_5_0.gemfile
|
18
|
-
- rvm: 2.5.7
|
19
|
-
gemfile: gemfiles/activerecord_5_1.gemfile
|
20
|
-
- rvm: 2.6.5
|
21
|
-
gemfile: gemfiles/activerecord_5_2.gemfile
|
22
|
-
- rvm: 2.7.0
|
23
|
-
gemfile: gemfiles/activerecord_6_0.gemfile
|
24
|
-
- rvm: 2.7.0
|
25
|
-
gemfile: gemfiles/activerecord_master.gemfile
|
26
|
-
|
27
|
-
before_install:
|
28
|
-
- gem update --system
|
29
|
-
- gem install bundler -v "~> 2.0"
|