webhook_system 2.2.0 → 2.4.0

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: a70d2874b3a9be03c3c1c99c39a2aafd7c84a3df03204ca2c97bc94bba2da812
4
- data.tar.gz: 7d3aa6e608f9fc0d650fd0a9562d2055deb77906b26d99284f25927cb13920a2
3
+ metadata.gz: afdbd7185d9cb4993052c2c5f7435d8b469f2d2623d31b63aadcd6aefd3e3c71
4
+ data.tar.gz: 05c32f9c6392d3fd9d3d9adf41fa8e21b21dafc8b87a9efd9b4236bf87137fbb
5
5
  SHA512:
6
- metadata.gz: afd6da24afebdb56a4549b567feed01ab0e23f6f7e172202017101748aa272cf2ce553b60493a46fddef38516766cfbc40333404eb26ef9594b88ffb06da68ee
7
- data.tar.gz: be103c12b745ce57f92fc1be610866d4e702c09472e84e467fc4214219a14ca506cd06358d445f3635f45b20bc568768ea1d84d85ea200c7255598b1ed3367be
6
+ metadata.gz: 66c102424aae48aa1d133abf5cd88c5233227e1c6b3604bf0c89558736d361c376b2c046e73031bdf5f0a3689c128e26188eae4188961ec476b410cf6f4da061
7
+ data.tar.gz: d03f803f206adcc70022a603b9ef02ba9a634e238924fd2a4b6cdf2c003e21c0783e4182ab09d9c5c326e727b64274eeb48bc9e7fc9b241bcf8e25740492e4bc
@@ -0,0 +1,56 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: build
9
+
10
+ on: [push, pull_request]
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-20.04
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ gemfile: ["rails_7.0"]
19
+ ruby: [2.7]
20
+ include:
21
+ - gemfile: rails_7.0
22
+ ruby: '3.1'
23
+ - gemfile: rails_6.1
24
+ ruby: '3.1'
25
+ - gemfile: rails_7.0
26
+ ruby: '3.0'
27
+ - gemfile: rails_6.1
28
+ ruby: '3.0'
29
+ - gemfile: rails_6.1
30
+ ruby: 2.7
31
+ - gemfile: rails_6.1
32
+ ruby: 2.6
33
+ - gemfile: rails_6.0
34
+ ruby: 2.7
35
+ - gemfile: rails_6.0
36
+ ruby: 2.6
37
+ - gemfile: rails_5.2
38
+ ruby: 2.6
39
+ - gemfile: rails_5.1
40
+ ruby: 2.6
41
+ - gemfile: rails_5.0
42
+ ruby: 2.6
43
+ - gemfile: rails_4.2
44
+ ruby: 2.6
45
+ - gemfile: rails_4.2
46
+ ruby: 2.5
47
+
48
+ env:
49
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
50
+ steps:
51
+ - uses: actions/checkout@v2
52
+ - uses: ruby/setup-ruby@v1
53
+ with:
54
+ ruby-version: ${{ matrix.ruby }}
55
+ bundler-cache: true
56
+ - run: bundle exec rake
@@ -0,0 +1,26 @@
1
+ name: "RuboCop Challenge"
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '30 23 * * 2,3,4' # この設定の場合、火水木のAM8:30に自動でPRが作られます。
6
+
7
+ jobs:
8
+ create-pr:
9
+ name: Create Pull Request
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - name: Set up Ruby 2.7
14
+ uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: 2.7.5
17
+ - name: Install bundler
18
+ run: gem install bundler
19
+ - name: Install gems
20
+ run: bundle install --jobs 4 --retry 3
21
+ - name: Set git configuration
22
+ run: git config remote.origin.url "git@github.com:payrollhero/webhook_system.git" # プロジェクトごとに変わる値です。
23
+ - name: Create RuboCop challenge pull request
24
+ env:
25
+ GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26
+ run: bundle exec rubocop_challenger go --base-branch=master --email=rubocop-challenger@example.com --name="Rubocop Challenger"
data/.gitignore CHANGED
@@ -1,7 +1,17 @@
1
+ # we don't commit .lock files
1
2
  Gemfile.lock
3
+ gemfiles/*.lock
4
+
2
5
  doc/
3
6
  pkg/
4
7
  *.db
5
8
  tmp/
9
+
10
+ # this is a good file to apps, not for gems
6
11
  .ruby-version
7
- gemfiles/*.lock
12
+
13
+ # don't want to be annoyed with gem builds
14
+ webhook_system-*.gem
15
+
16
+ # so rubocop-challenger does not complain about uncommited files
17
+ .bundle/*
data/.rubocop.hound.yml CHANGED
@@ -13,7 +13,7 @@ Style/CollectionMethods:
13
13
  find: detect
14
14
  find_all: select
15
15
  reduce: inject
16
- Style/DotPosition:
16
+ Layout/DotPosition:
17
17
  Description: Checks the position of the dot in multi-line method calls.
18
18
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
19
19
  Enabled: true
@@ -21,11 +21,7 @@ Style/DotPosition:
21
21
  SupportedStyles:
22
22
  - leading
23
23
  - trailing
24
- Style/FileName:
25
- Description: Use snake_case for source file names.
26
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
27
- Enabled: false
28
- Exclude: []
24
+
29
25
  Style/GuardClause:
30
26
  Description: Check for conditionals that can be replaced with guard clauses
31
27
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
@@ -35,7 +31,6 @@ Style/IfUnlessModifier:
35
31
  Description: Favor modifier if/unless usage when you have a single-line body.
36
32
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
37
33
  Enabled: false
38
- MaxLineLength: 80
39
34
  Style/OptionHash:
40
35
  Description: Don't use option hashes when you can use keyword arguments.
41
36
  Enabled: false
@@ -53,7 +48,7 @@ Style/PercentLiteralDelimiters:
53
48
  "%w": "()"
54
49
  "%W": "()"
55
50
  "%x": "()"
56
- Style/PredicateName:
51
+ Naming/PredicateName:
57
52
  Description: Check the names of predicate methods.
58
53
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
59
54
  Enabled: true
@@ -61,7 +56,7 @@ Style/PredicateName:
61
56
  - is_
62
57
  - has_
63
58
  - have_
64
- NamePrefixBlacklist:
59
+ ForbiddenPrefixes:
65
60
  - is_
66
61
  Exclude:
67
62
  - spec/**/*
@@ -114,24 +109,9 @@ Style/StringLiteralsInInterpolation:
114
109
  SupportedStyles:
115
110
  - single_quotes
116
111
  - double_quotes
117
- Style/TrailingCommaInArguments:
118
- Description: 'Checks for trailing comma in argument lists.'
119
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
120
- Enabled: false
121
- EnforcedStyleForMultiline: no_comma
122
- SupportedStyles:
123
- - comma
124
- - consistent_comma
125
- - no_comma
126
- Style/TrailingCommaInLiteral:
127
- Description: 'Checks for trailing comma in array and hash literals.'
128
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
129
- Enabled: false
130
- EnforcedStyleForMultiline: no_comma
131
- SupportedStyles:
132
- - comma
133
- - consistent_comma
134
- - no_comma
112
+
113
+
114
+
135
115
  Metrics/AbcSize:
136
116
  Description: A calculated magnitude based on number of assignments, branches, and
137
117
  conditions.
@@ -177,7 +157,7 @@ Lint/AssignmentInCondition:
177
157
  Style/InlineComment:
178
158
  Description: Avoid inline comments.
179
159
  Enabled: false
180
- Style/AccessorMethodName:
160
+ Naming/AccessorMethodName:
181
161
  Description: Check the naming of accessor methods for get_/set_.
182
162
  Enabled: false
183
163
  Style/Alias:
@@ -231,13 +211,11 @@ Style/WhenThen:
231
211
  Lint/EachWithObjectArgument:
232
212
  Description: Check for immutable argument given to each_with_object.
233
213
  Enabled: true
234
- Lint/HandleExceptions:
214
+ Lint/SuppressedException:
235
215
  Description: Don't suppress exception.
236
216
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
237
217
  Enabled: false
238
- Lint/LiteralInCondition:
239
- Description: Checks of literals used in conditions.
240
- Enabled: false
218
+
241
219
  Lint/LiteralInInterpolation:
242
220
  Description: Checks for literals used in interpolation.
243
221
  Enabled: false
data/.rubocop.yml CHANGED
@@ -1,7 +1,9 @@
1
1
  inherit_from:
2
- - .rubocop.hound.yml
2
+ - .rubocop_todo.yml
3
+ - .rubocop.hound.yml
3
4
 
4
5
  AllCops:
6
+ NewCops: enable
5
7
  Exclude:
6
8
  - '*.gemspec'
7
9
  - 'Gemfile'
@@ -9,13 +11,13 @@ AllCops:
9
11
  Style/Lambda:
10
12
  Enabled: false
11
13
 
12
- Style/EmptyLinesAroundClassBody:
14
+ Layout/EmptyLinesAroundClassBody:
13
15
  Enabled: false
14
16
 
15
- Style/EmptyLinesAroundModuleBody:
17
+ Layout/EmptyLinesAroundModuleBody:
16
18
  Enabled: false
17
19
 
18
- Style/EmptyLinesAroundMethodBody:
20
+ Layout/EmptyLinesAroundMethodBody:
19
21
  Enabled: false
20
22
 
21
23
  Style/ClassCheck:
@@ -25,7 +27,7 @@ Style/ClassCheck:
25
27
  Style/StringLiterals:
26
28
  Enabled: false
27
29
 
28
- Style/FileName:
30
+ Naming/FileName:
29
31
  Enabled: false
30
32
 
31
33
  Style/RedundantException:
@@ -37,12 +39,8 @@ Style/SignalException:
37
39
  Style/BlockDelimiters:
38
40
  Enabled: false
39
41
 
40
- Style/CollectionMethods:
41
- PreferredMethods:
42
- detect: find
43
-
44
42
  # Github's PR width is 120 characters
45
- Metrics/LineLength:
43
+ Layout/LineLength:
46
44
  Max: 120
47
45
  AllowURI: true
48
46
  Exclude:
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,177 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2022-04-27 12:05:35 UTC using RuboCop version 1.28.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # This cop supports safe auto-correction (--auto-correct).
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
+ # Include: **/*.gemfile, **/Gemfile, **/gems.rb
13
+ Bundler/OrderedGems:
14
+ Exclude:
15
+ - 'gemfiles/rails_6.1.gemfile'
16
+
17
+ # Offense count: 1
18
+ # This cop supports safe auto-correction (--auto-correct).
19
+ # Configuration parameters: EnforcedStyle.
20
+ # SupportedStyles: empty_lines, no_empty_lines
21
+ Layout/EmptyLinesAroundBlockBody:
22
+ Exclude:
23
+ - 'spec/encoder_spec.rb'
24
+
25
+ # Offense count: 2
26
+ # This cop supports safe auto-correction (--auto-correct).
27
+ # Configuration parameters: EnforcedStyle.
28
+ # SupportedStyles: space, no_space
29
+ Layout/SpaceAroundEqualsInParameterDefault:
30
+ Exclude:
31
+ - 'lib/webhook_system/base_event.rb'
32
+ - 'lib/webhook_system/job.rb'
33
+
34
+ # Offense count: 1
35
+ # This cop supports safe auto-correction (--auto-correct).
36
+ # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
37
+ # SupportedStylesForExponentOperator: space, no_space
38
+ Layout/SpaceAroundOperators:
39
+ Exclude:
40
+ - 'lib/webhook_system/subscription.rb'
41
+
42
+ # Offense count: 2
43
+ # This cop supports safe auto-correction (--auto-correct).
44
+ # Configuration parameters: EnforcedStyle.
45
+ # SupportedStyles: require_no_space, require_space
46
+ Layout/SpaceInLambdaLiteral:
47
+ Exclude:
48
+ - 'lib/webhook_system/subscription.rb'
49
+
50
+ # Offense count: 2
51
+ # This cop supports safe auto-correction (--auto-correct).
52
+ Lint/DeprecatedOpenSSLConstant:
53
+ Exclude:
54
+ - 'lib/webhook_system/encoder.rb'
55
+
56
+ # Offense count: 1
57
+ # This cop supports unsafe auto-correction (--auto-correct-all).
58
+ Lint/NonDeterministicRequireOrder:
59
+ Exclude:
60
+ - 'spec/spec_helper.rb'
61
+
62
+ # Offense count: 1
63
+ Lint/UnreachableCode:
64
+ Exclude:
65
+ - 'lib/webhook_system/job.rb'
66
+
67
+ # Offense count: 11
68
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
69
+ # IgnoredMethods: refine
70
+ Metrics/BlockLength:
71
+ Max: 112
72
+
73
+ # Offense count: 1
74
+ # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
75
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
76
+ Naming/MethodParameterName:
77
+ Exclude:
78
+ - 'lib/webhook_system/encoder.rb'
79
+
80
+ # Offense count: 1
81
+ # This cop supports safe auto-correction (--auto-correct).
82
+ # Configuration parameters: PreferredName.
83
+ Naming/RescuedExceptionsVariableName:
84
+ Exclude:
85
+ - 'lib/webhook_system/job.rb'
86
+
87
+ # Offense count: 2
88
+ # This cop supports safe auto-correction (--auto-correct).
89
+ Security/JSONLoad:
90
+ Exclude:
91
+ - 'lib/webhook_system/encoder.rb'
92
+
93
+ # Offense count: 1
94
+ # This cop supports safe auto-correction (--auto-correct).
95
+ Style/FileWrite:
96
+ Exclude:
97
+ - 'Rakefile'
98
+
99
+ # This cop supports safe auto-correction (--auto-correct).
100
+ # Configuration parameters: EnforcedStyle.
101
+ # SupportedStyles: literals, strict
102
+ Style/MutableConstant:
103
+ Exclude:
104
+ - 'lib/webhook_system/subscription.rb'
105
+
106
+ # Offense count: 1
107
+ # This cop supports unsafe auto-correction (--auto-correct-all).
108
+ # Configuration parameters: EnforcedStyle, IgnoredMethods.
109
+ # SupportedStyles: predicate, comparison
110
+ Style/NumericPredicate:
111
+ Exclude:
112
+ - 'spec/**/*'
113
+ - 'lib/webhook_system/job.rb'
114
+
115
+ # Offense count: 1
116
+ # This cop supports safe auto-correction (--auto-correct).
117
+ Style/Proc:
118
+ Exclude:
119
+ - 'lib/webhook_system/subscription.rb'
120
+
121
+ # Offense count: 1
122
+ # This cop supports safe auto-correction (--auto-correct).
123
+ Style/RedundantSelf:
124
+ Exclude:
125
+ - 'lib/webhook_system/base_event.rb'
126
+
127
+ # Offense count: 1
128
+ # This cop supports safe auto-correction (--auto-correct).
129
+ # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
130
+ # SupportedStyles: slashes, percent_r, mixed
131
+ Style/RegexpLiteral:
132
+ Exclude:
133
+ - 'spec/dispatching_events_spec.rb'
134
+
135
+ # Offense count: 2
136
+ # This cop supports safe auto-correction (--auto-correct).
137
+ Style/StderrPuts:
138
+ Exclude:
139
+ - 'Rakefile'
140
+
141
+ # Offense count: 1
142
+ # This cop supports unsafe auto-correction (--auto-correct-all).
143
+ # Configuration parameters: Mode.
144
+ Style/StringConcatenation:
145
+ Exclude:
146
+ - 'lib/webhook_system/encoder.rb'
147
+
148
+ # Offense count: 4
149
+ # This cop supports safe auto-correction (--auto-correct).
150
+ # Configuration parameters: MinSize.
151
+ # SupportedStyles: percent, brackets
152
+ Style/SymbolArray:
153
+ EnforcedStyle: brackets
154
+
155
+ # Offense count: 3
156
+ # This cop supports safe auto-correction (--auto-correct).
157
+ # Configuration parameters: EnforcedStyleForMultiline.
158
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
159
+ Style/TrailingCommaInArrayLiteral:
160
+ Exclude:
161
+ - 'spec/dispatching_events_spec.rb'
162
+ - 'spec/event_spec.rb'
163
+ - 'spec/integration_spec.rb'
164
+
165
+ # Offense count: 14
166
+ # This cop supports safe auto-correction (--auto-correct).
167
+ # Configuration parameters: EnforcedStyleForMultiline.
168
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
169
+ Style/TrailingCommaInHashLiteral:
170
+ Exclude:
171
+ - 'lib/webhook_system/base_event.rb'
172
+ - 'lib/webhook_system/encoder.rb'
173
+ - 'lib/webhook_system/event_log.rb'
174
+ - 'lib/webhook_system/subscription.rb'
175
+ - 'spec/encoder_spec.rb'
176
+ - 'spec/event_spec.rb'
177
+ - 'spec/integration_spec.rb'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.4.0](https://github.com/payrollhero/webhook_system/tree/v2.4.0) (2022-05-02)
4
+ [Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.3.1...v2.4.0)
5
+
6
+ * Rails 7.0 Official support.
7
+ * Please read Upgrade notes, a migration is required to rename encrypt column to encrypted.
8
+
9
+ ## [v2.3.1](https://github.com/payrollhero/webhook_system/tree/v2.3.1) (2022-04-27)
10
+ [Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.3.0...v2.3.1)
11
+
12
+ * Rails 6.1 Official support.
13
+
14
+ ## [v2.3.0](https://github.com/payrollhero/webhook_system/tree/v2.3.0) (2021-08-xx)
15
+ [Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.2.0...v2.3.0)
16
+
17
+ * Add ability to launch inline jobs instead of making external HTTP calls to another service.
18
+
3
19
  ## [v2.2.0](https://github.com/payrollhero/webhook_system/tree/v2.2.0) (2019-11-07)
4
20
  [Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.1.6...v2.2.0)
5
21
 
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  source 'https://rubygems.org'
2
+ gem 'pr_comet', git: 'https://github.com/mathieujobin/pr_comet', branch: 'git-status'
2
3
 
3
4
  gemspec
data/README.md CHANGED
@@ -21,6 +21,22 @@ Few Main points ..
21
21
  4. The webhook is delivered to the recipient as a JSON payload with a base64 encoded data component
22
22
  5. The recipient is meant to use their copy of this secret to decode that payload, and then action it as needed.
23
23
 
24
+ ## Upgrading
25
+
26
+ If you are upgrading from <= 2.3.1 into >= 2.4, then you must run a migration to rename the `encrypt` column.
27
+ This rename was required for adding support for Rails 7.
28
+
29
+ You can use this migration.
30
+
31
+ ```ruby
32
+ # db/migrate/20220427113942_rename_encrypt_on_webhook_subscriptions.rb
33
+ class RenameEncryptOnWebhookSubscriptions < ActiveRecord::Migration[7.0]
34
+ def change
35
+ rename_column :webhook_subscriptions, :encrypt, :encrypted
36
+ end
37
+ end
38
+ ```
39
+
24
40
  ## Setup
25
41
 
26
42
  The webhook integration code runs on two tables. You need to create a new migration that adds these
@@ -30,7 +46,7 @@ tables first:
30
46
  create_table :webhook_subscriptions do |t|
31
47
  t.string :url, null: false
32
48
  t.boolean :active, null: false, index: true
33
- t.boolean :encrypt, null: false, default: false
49
+ t.boolean :encrypted, null: false, default: false
34
50
  t.text :secret
35
51
  end
36
52
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
 
3
5
  require 'rubygems/tasks'
@@ -1,4 +1,4 @@
1
- # This file was generated by Appraisal
1
+ # frozen_string_literal: true
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
@@ -0,0 +1,295 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ webhook_system (2.3.1)
5
+ activejob (> 4.2, < 7.1)
6
+ activerecord (> 4.2, < 7.1)
7
+ activesupport (> 4.2, < 7.1)
8
+ faraday (> 0.9)
9
+ faraday-encoding (>= 0.0.2, < 1.0)
10
+ ph_model
11
+ validate_url (~> 1.0)
12
+
13
+ GEM
14
+ remote: https://rubygems.org/
15
+ specs:
16
+ actionmailer (4.2.11.3)
17
+ actionpack (= 4.2.11.3)
18
+ actionview (= 4.2.11.3)
19
+ activejob (= 4.2.11.3)
20
+ mail (~> 2.5, >= 2.5.4)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ actionpack (4.2.11.3)
23
+ actionview (= 4.2.11.3)
24
+ activesupport (= 4.2.11.3)
25
+ rack (~> 1.6)
26
+ rack-test (~> 0.6.2)
27
+ rails-dom-testing (~> 1.0, >= 1.0.5)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ actionview (4.2.11.3)
30
+ activesupport (= 4.2.11.3)
31
+ builder (~> 3.1)
32
+ erubis (~> 2.7.0)
33
+ rails-dom-testing (~> 1.0, >= 1.0.5)
34
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
+ active_attr (0.15.4)
36
+ actionpack (>= 3.0.2, < 7.1)
37
+ activemodel (>= 3.0.2, < 7.1)
38
+ activesupport (>= 3.0.2, < 7.1)
39
+ activejob (4.2.11.3)
40
+ activesupport (= 4.2.11.3)
41
+ globalid (>= 0.3.0)
42
+ activemodel (4.2.11.3)
43
+ activesupport (= 4.2.11.3)
44
+ builder (~> 3.1)
45
+ activerecord (4.2.11.3)
46
+ activemodel (= 4.2.11.3)
47
+ activesupport (= 4.2.11.3)
48
+ arel (~> 6.0)
49
+ activesupport (4.2.11.3)
50
+ i18n (~> 0.7)
51
+ minitest (~> 5.1)
52
+ thread_safe (~> 0.3, >= 0.3.4)
53
+ tzinfo (~> 1.1)
54
+ addressable (2.8.0)
55
+ public_suffix (>= 2.0.2, < 5.0)
56
+ arel (6.0.4)
57
+ ast (2.4.2)
58
+ async (1.30.1)
59
+ console (~> 1.10)
60
+ nio4r (~> 2.3)
61
+ timers (~> 4.1)
62
+ async-http (0.56.5)
63
+ async (>= 1.25)
64
+ async-io (>= 1.28)
65
+ async-pool (>= 0.2)
66
+ protocol-http (~> 0.22.0)
67
+ protocol-http1 (~> 0.14.0)
68
+ protocol-http2 (~> 0.14.0)
69
+ async-http-faraday (0.11.0)
70
+ async-http (~> 0.42)
71
+ faraday
72
+ async-io (1.33.0)
73
+ async
74
+ async-pool (0.3.9)
75
+ async (>= 1.25)
76
+ builder (3.2.4)
77
+ concurrent-ruby (1.1.10)
78
+ console (1.15.0)
79
+ fiber-local
80
+ crack (0.4.5)
81
+ rexml
82
+ crass (1.0.6)
83
+ diff-lcs (1.5.0)
84
+ erubis (2.7.0)
85
+ factory_bot (5.2.0)
86
+ activesupport (>= 4.2.0)
87
+ faraday (1.10.0)
88
+ faraday-em_http (~> 1.0)
89
+ faraday-em_synchrony (~> 1.0)
90
+ faraday-excon (~> 1.1)
91
+ faraday-httpclient (~> 1.0)
92
+ faraday-multipart (~> 1.0)
93
+ faraday-net_http (~> 1.0)
94
+ faraday-net_http_persistent (~> 1.0)
95
+ faraday-patron (~> 1.0)
96
+ faraday-rack (~> 1.0)
97
+ faraday-retry (~> 1.0)
98
+ ruby2_keywords (>= 0.0.4)
99
+ faraday-em_http (1.0.0)
100
+ faraday-em_synchrony (1.0.0)
101
+ faraday-encoding (0.0.5)
102
+ faraday
103
+ faraday-excon (1.1.0)
104
+ faraday-http-cache (2.2.0)
105
+ faraday (>= 0.8)
106
+ faraday-httpclient (1.0.1)
107
+ faraday-multipart (1.0.3)
108
+ multipart-post (>= 1.2, < 3)
109
+ faraday-net_http (1.0.1)
110
+ faraday-net_http_persistent (1.2.0)
111
+ faraday-patron (1.0.0)
112
+ faraday-rack (1.0.0)
113
+ faraday-retry (1.0.3)
114
+ fiber-local (1.0.0)
115
+ github_changelog_generator (1.16.4)
116
+ activesupport
117
+ async (>= 1.25.0)
118
+ async-http-faraday
119
+ faraday-http-cache
120
+ multi_json
121
+ octokit (~> 4.6)
122
+ rainbow (>= 2.2.1)
123
+ rake (>= 10.0)
124
+ globalid (0.4.2)
125
+ activesupport (>= 4.2.0)
126
+ hashdiff (1.0.1)
127
+ i18n (0.9.5)
128
+ concurrent-ruby (~> 1.0)
129
+ io-console (0.5.9)
130
+ irb (1.4.1)
131
+ reline (>= 0.3.0)
132
+ loofah (2.16.0)
133
+ crass (~> 1.0.2)
134
+ nokogiri (>= 1.5.9)
135
+ mail (2.7.1)
136
+ mini_mime (>= 0.1.1)
137
+ mini_mime (1.1.2)
138
+ mini_portile2 (2.6.1)
139
+ minitest (5.15.0)
140
+ multi_json (1.15.0)
141
+ multipart-post (2.1.1)
142
+ nio4r (2.5.8)
143
+ nokogiri (1.12.5)
144
+ mini_portile2 (~> 2.6.1)
145
+ racc (~> 1.4)
146
+ octokit (4.22.0)
147
+ faraday (>= 0.9)
148
+ sawyer (~> 0.8.0, >= 0.5.3)
149
+ parallel (1.22.1)
150
+ parser (3.1.2.0)
151
+ ast (~> 2.4.1)
152
+ ph_model (1.1.3)
153
+ active_attr (~> 0.8)
154
+ activemodel (> 3.2)
155
+ activesupport (> 3.2)
156
+ pr_comet (0.5.1)
157
+ octokit
158
+ rainbow
159
+ protocol-hpack (1.4.2)
160
+ protocol-http (0.22.5)
161
+ protocol-http1 (0.14.2)
162
+ protocol-http (~> 0.22)
163
+ protocol-http2 (0.14.2)
164
+ protocol-hpack (~> 1.4)
165
+ protocol-http (~> 0.18)
166
+ public_suffix (4.0.7)
167
+ racc (1.6.0)
168
+ rack (1.6.13)
169
+ rack-test (0.6.3)
170
+ rack (>= 1.0)
171
+ rails (4.2.11.3)
172
+ actionmailer (= 4.2.11.3)
173
+ actionpack (= 4.2.11.3)
174
+ actionview (= 4.2.11.3)
175
+ activejob (= 4.2.11.3)
176
+ activemodel (= 4.2.11.3)
177
+ activerecord (= 4.2.11.3)
178
+ activesupport (= 4.2.11.3)
179
+ bundler (>= 1.3.0, < 2.0)
180
+ railties (= 4.2.11.3)
181
+ sprockets-rails
182
+ rails-deprecated_sanitizer (1.0.4)
183
+ activesupport (>= 4.2.0.alpha)
184
+ rails-dom-testing (1.0.9)
185
+ activesupport (>= 4.2.0, < 5.0)
186
+ nokogiri (~> 1.6)
187
+ rails-deprecated_sanitizer (>= 1.0.1)
188
+ rails-html-sanitizer (1.4.2)
189
+ loofah (~> 2.3)
190
+ railties (4.2.11.3)
191
+ actionpack (= 4.2.11.3)
192
+ activesupport (= 4.2.11.3)
193
+ rake (>= 0.8.7)
194
+ thor (>= 0.18.1, < 2.0)
195
+ rainbow (3.1.1)
196
+ rake (13.0.6)
197
+ regexp_parser (2.3.1)
198
+ reline (0.3.1)
199
+ io-console (~> 0.5)
200
+ rexml (3.2.5)
201
+ rspec (3.11.0)
202
+ rspec-core (~> 3.11.0)
203
+ rspec-expectations (~> 3.11.0)
204
+ rspec-mocks (~> 3.11.0)
205
+ rspec-core (3.11.0)
206
+ rspec-support (~> 3.11.0)
207
+ rspec-expectations (3.11.0)
208
+ diff-lcs (>= 1.2.0, < 2.0)
209
+ rspec-support (~> 3.11.0)
210
+ rspec-mocks (3.11.1)
211
+ diff-lcs (>= 1.2.0, < 2.0)
212
+ rspec-support (~> 3.11.0)
213
+ rspec-support (3.11.0)
214
+ rubocop (1.28.2)
215
+ parallel (~> 1.10)
216
+ parser (>= 3.1.0.0)
217
+ rainbow (>= 2.2.2, < 4.0)
218
+ regexp_parser (>= 1.8, < 3.0)
219
+ rexml
220
+ rubocop-ast (>= 1.17.0, < 2.0)
221
+ ruby-progressbar (~> 1.7)
222
+ unicode-display_width (>= 1.4.0, < 3.0)
223
+ rubocop-ast (1.17.0)
224
+ parser (>= 3.1.1.0)
225
+ rubocop-performance (1.13.3)
226
+ rubocop (>= 1.7.0, < 2.0)
227
+ rubocop-ast (>= 0.4.0)
228
+ rubocop-rails (2.14.2)
229
+ activesupport (>= 4.2.0)
230
+ rack (>= 1.1)
231
+ rubocop (>= 1.7.0, < 2.0)
232
+ rubocop-rake (0.6.0)
233
+ rubocop (~> 1.0)
234
+ rubocop-rspec (2.10.0)
235
+ rubocop (~> 1.19)
236
+ rubocop_challenger (2.3.0)
237
+ pr_comet (~> 0.5.1)
238
+ rainbow
239
+ rubocop (>= 0.87)
240
+ rubocop-performance
241
+ rubocop-rails
242
+ rubocop-rake
243
+ rubocop-rspec
244
+ thor
245
+ yard
246
+ ruby-progressbar (1.11.0)
247
+ ruby2_keywords (0.0.5)
248
+ rubygems-tasks (0.2.5)
249
+ irb (~> 1.0)
250
+ sawyer (0.8.2)
251
+ addressable (>= 2.3.5)
252
+ faraday (> 0.8, < 2.0)
253
+ sprockets (4.0.3)
254
+ concurrent-ruby (~> 1.0)
255
+ rack (> 1, < 3)
256
+ sprockets-rails (3.2.2)
257
+ actionpack (>= 4.0)
258
+ activesupport (>= 4.0)
259
+ sprockets (>= 3.0.0)
260
+ sqlite3 (1.3.13)
261
+ thor (1.2.1)
262
+ thread_safe (0.3.6)
263
+ timers (4.3.3)
264
+ tzinfo (1.2.9)
265
+ thread_safe (~> 0.1)
266
+ unicode-display_width (2.1.0)
267
+ validate_url (1.0.13)
268
+ activemodel (>= 3.0.0)
269
+ public_suffix
270
+ webmock (3.14.0)
271
+ addressable (>= 2.8.0)
272
+ crack (>= 0.3.2)
273
+ hashdiff (>= 0.4.0, < 2.0.0)
274
+ webrick (1.7.0)
275
+ yard (0.9.27)
276
+ webrick (~> 1.7.0)
277
+
278
+ PLATFORMS
279
+ ruby
280
+
281
+ DEPENDENCIES
282
+ bundler (> 1.17, < 2.5)
283
+ factory_bot
284
+ github_changelog_generator (~> 1.6)
285
+ rails (~> 4.2.11)
286
+ rake
287
+ rspec (~> 3.0)
288
+ rubocop_challenger
289
+ rubygems-tasks (~> 0.2)
290
+ sqlite3 (~> 1.3.6)
291
+ webhook_system!
292
+ webmock
293
+
294
+ BUNDLED WITH
295
+ 1.17.3
@@ -1,8 +1,8 @@
1
- # This file was generated by Appraisal
1
+ # frozen_string_literal: true
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 5.0.1"
5
+ gem "rails", "~> 5.0.7"
6
6
  gem "sqlite3", "~> 1.3.6"
7
7
 
8
8
  gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 5.1.7"
6
+ gem "sqlite3", "~> 1.3.6"
7
+
8
+ gemspec path: "../"
@@ -1,8 +1,8 @@
1
- # This file was generated by Appraisal
1
+ # frozen_string_literal: true
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 5.2.1"
5
+ gem "rails", "~> 5.2.6"
6
6
  gem "sqlite3", "~> 1.4.1"
7
7
 
8
8
  gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 6.0.4"
6
+ gem "sqlite3"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 6.1.4"
6
+ gem "sqlite3"
7
+ gem "minitest"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 7.0.2"
4
+ gem "sqlite3"
5
+
6
+ gemspec path: "../"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WebhookSystem
2
4
 
3
5
  # This is the class meant to be used as the base class for any Events sent through the Webhook system
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WebhookSystem
2
4
 
3
5
  # Class in charge of encoding and decoding encrypted payload
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WebhookSystem
2
4
 
3
5
  # This is the model holding on to all webhook responses
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WebhookSystem
2
4
 
3
5
  # This is the ActiveJob in charge of actually sending each event
@@ -32,7 +34,22 @@ module WebhookSystem
32
34
  end
33
35
 
34
36
  def perform(subscription, event)
35
- self.class.post(subscription, event)
37
+ if subscription.url.match?(/^https?:/)
38
+ self.class.post(subscription, event)
39
+ elsif (match_data = subscription.url.match(/^inline:(.*)/)).present?
40
+ self.class.call_inline(match_data[1], subscription, event)
41
+ else
42
+ raise RuntimeError, "unknown prefix url for subscription"
43
+ ensure_success(ErrorResponse.new(exception), :INVALID, subscription)
44
+ end
45
+ end
46
+
47
+ def self.call_inline(job_name, subscription, event)
48
+ # subscription url could contain a job name, or a ruby class/method call
49
+ # how do we sanitize this not to be allowing hackers to call arbitrary code via
50
+ # a subscription? maybe a prefix is enough?
51
+ job_class = const_get("WebhookSystem::Inline#{job_name}Job")
52
+ job_class.perform_now(subscription, event)
36
53
  end
37
54
 
38
55
  def self.post(subscription, event)
@@ -75,7 +92,7 @@ module WebhookSystem
75
92
  end
76
93
 
77
94
  def self.format_for_subscription(subscription)
78
- subscription.encrypt ? 'base64+aes256' : 'json'
95
+ subscription.encrypted ? 'base64+aes256' : 'json'
79
96
  end
80
97
 
81
98
  def self.log_response(subscription, event, request, response)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WebhookSystem
2
4
 
3
5
  # This is the model encompassing the actual record of a webhook subscription
@@ -6,7 +8,8 @@ module WebhookSystem
6
8
 
7
9
  belongs_to :account if defined?(Account)
8
10
 
9
- validates :url, presence: true, url: { no_local: true }
11
+ INLINE_JOB_REGEXP=/^inline:(.*)/
12
+ validates :url, presence: true, url: { no_local: true }, if: Proc.new { |a| !a.url.match?(INLINE_JOB_REGEXP) }
10
13
  validates :secret, presence: true
11
14
 
12
15
  has_many :topics, class_name: 'WebhookSystem::SubscriptionTopic', dependent: :destroy
@@ -33,7 +36,11 @@ module WebhookSystem
33
36
 
34
37
  # Just a helper to get a nice representation of the subscription
35
38
  def url_domain
36
- URI.parse(url).host
39
+ if data = url.match(INLINE_JOB_REGEXP)
40
+ data[1]
41
+ else
42
+ URI.parse(url).host
43
+ end
37
44
  end
38
45
 
39
46
  # Abstraction around the topics relation, returns an array of the subscribed topic names
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WebhookSystem
2
4
  class SubscriptionTopic < ActiveRecord::Base
3
5
  self.table_name = 'webhook_subscription_topics'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WebhookSystem
2
- VERSION = '2.2.0'
4
+ VERSION = '2.4.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support/all'
2
4
  require 'active_record'
3
5
  require 'active_job'
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.name = 'webhook_system'
7
7
  gem.version = WebhookSystem::VERSION
8
8
  gem.authors = ['Piotr Banasik', 'Mykola Kyryk']
9
- gem.email = 'piotr@payrollhero.com'
9
+ gem.email = 'dev@payrollhero.com'
10
10
 
11
11
  gem.summary = 'Webhook system'
12
12
  gem.description = 'A pluggable webhook subscription system'
@@ -18,25 +18,41 @@ Gem::Specification.new do |gem|
18
18
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
19
19
  gem.require_paths = ['lib']
20
20
 
21
- gem.add_runtime_dependency 'activesupport', '> 3.2'#, '< 5.0' # have to drop support for ruby 2.1 if we enable 5.0
22
- gem.add_runtime_dependency 'activerecord', '> 3.2'#, '< 5.0' # have to drop support for ruby 2.1 if we enable 5.0
23
- gem.add_runtime_dependency 'activejob'
24
- gem.add_runtime_dependency 'faraday', '~> 0.9'
21
+ gem.post_install_message = %q{
22
+ ## Upgrading
23
+
24
+ If you are upgrading from <= 2.3.1 into >= 2.4, then you must run a migration to rename the `encrypt` column.
25
+ This rename was required for adding support for Rails 7.
26
+
27
+ You can use this migration.
28
+
29
+ ```ruby
30
+ # db/migrate/20220427113942_rename_encrypt_on_webhook_subscriptions.rb
31
+ class RenameEncryptOnWebhookSubscriptions < ActiveRecord::Migration[7.0]
32
+ def change
33
+ rename_column :webhook_subscriptions, :encrypt, :encrypted
34
+ end
35
+ end
36
+ ```
37
+ }
38
+
39
+ gem.add_runtime_dependency 'activesupport', '> 4.2', '< 7.1'
40
+ gem.add_runtime_dependency 'activerecord', '> 4.2', '< 7.1'
41
+ gem.add_runtime_dependency 'activejob', '> 4.2', '< 7.1'
42
+ gem.add_runtime_dependency 'faraday', '> 0.9'
25
43
  gem.add_runtime_dependency 'faraday-encoding', '>= 0.0.2', '< 1.0'
26
44
  gem.add_runtime_dependency 'ph_model'
27
45
  gem.add_runtime_dependency 'validate_url', '~> 1.0'
28
46
 
29
- gem.add_development_dependency 'bundler', '> 1.0', '< 2.5'
47
+ gem.add_development_dependency 'bundler', '> 1.17', '< 2.5'
30
48
  gem.add_development_dependency 'rake'
31
49
  gem.add_development_dependency 'rspec', '~> 3.0'
32
50
  gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
33
- gem.add_development_dependency 'pry'
34
51
  gem.add_development_dependency 'sqlite3'
35
52
  gem.add_development_dependency 'github_changelog_generator', '~> 1.6'
36
- gem.add_development_dependency 'factory_girl'
53
+ gem.add_development_dependency 'factory_bot'
37
54
  gem.add_development_dependency 'webmock'
38
- gem.add_development_dependency 'appraisal'
39
55
 
40
56
  # static analysis gems
41
- gem.add_development_dependency 'rubocop', '~> 0.48.1'
57
+ gem.add_development_dependency 'rubocop_challenger'
42
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webhook_system
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Banasik
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-11-11 00:00:00.000000000 Z
12
+ date: 2022-05-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -17,54 +17,72 @@ dependencies:
17
17
  requirements:
18
18
  - - ">"
19
19
  - !ruby/object:Gem::Version
20
- version: '3.2'
20
+ version: '4.2'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '7.1'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
28
  - - ">"
26
29
  - !ruby/object:Gem::Version
27
- version: '3.2'
30
+ version: '4.2'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '7.1'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: activerecord
30
36
  requirement: !ruby/object:Gem::Requirement
31
37
  requirements:
32
38
  - - ">"
33
39
  - !ruby/object:Gem::Version
34
- version: '3.2'
40
+ version: '4.2'
41
+ - - "<"
42
+ - !ruby/object:Gem::Version
43
+ version: '7.1'
35
44
  type: :runtime
36
45
  prerelease: false
37
46
  version_requirements: !ruby/object:Gem::Requirement
38
47
  requirements:
39
48
  - - ">"
40
49
  - !ruby/object:Gem::Version
41
- version: '3.2'
50
+ version: '4.2'
51
+ - - "<"
52
+ - !ruby/object:Gem::Version
53
+ version: '7.1'
42
54
  - !ruby/object:Gem::Dependency
43
55
  name: activejob
44
56
  requirement: !ruby/object:Gem::Requirement
45
57
  requirements:
46
- - - ">="
58
+ - - ">"
47
59
  - !ruby/object:Gem::Version
48
- version: '0'
60
+ version: '4.2'
61
+ - - "<"
62
+ - !ruby/object:Gem::Version
63
+ version: '7.1'
49
64
  type: :runtime
50
65
  prerelease: false
51
66
  version_requirements: !ruby/object:Gem::Requirement
52
67
  requirements:
53
- - - ">="
68
+ - - ">"
54
69
  - !ruby/object:Gem::Version
55
- version: '0'
70
+ version: '4.2'
71
+ - - "<"
72
+ - !ruby/object:Gem::Version
73
+ version: '7.1'
56
74
  - !ruby/object:Gem::Dependency
57
75
  name: faraday
58
76
  requirement: !ruby/object:Gem::Requirement
59
77
  requirements:
60
- - - "~>"
78
+ - - ">"
61
79
  - !ruby/object:Gem::Version
62
80
  version: '0.9'
63
81
  type: :runtime
64
82
  prerelease: false
65
83
  version_requirements: !ruby/object:Gem::Requirement
66
84
  requirements:
67
- - - "~>"
85
+ - - ">"
68
86
  - !ruby/object:Gem::Version
69
87
  version: '0.9'
70
88
  - !ruby/object:Gem::Dependency
@@ -121,7 +139,7 @@ dependencies:
121
139
  requirements:
122
140
  - - ">"
123
141
  - !ruby/object:Gem::Version
124
- version: '1.0'
142
+ version: '1.17'
125
143
  - - "<"
126
144
  - !ruby/object:Gem::Version
127
145
  version: '2.5'
@@ -131,7 +149,7 @@ dependencies:
131
149
  requirements:
132
150
  - - ">"
133
151
  - !ruby/object:Gem::Version
134
- version: '1.0'
152
+ version: '1.17'
135
153
  - - "<"
136
154
  - !ruby/object:Gem::Version
137
155
  version: '2.5'
@@ -177,20 +195,6 @@ dependencies:
177
195
  - - "~>"
178
196
  - !ruby/object:Gem::Version
179
197
  version: '0.2'
180
- - !ruby/object:Gem::Dependency
181
- name: pry
182
- requirement: !ruby/object:Gem::Requirement
183
- requirements:
184
- - - ">="
185
- - !ruby/object:Gem::Version
186
- version: '0'
187
- type: :development
188
- prerelease: false
189
- version_requirements: !ruby/object:Gem::Requirement
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- version: '0'
194
198
  - !ruby/object:Gem::Dependency
195
199
  name: sqlite3
196
200
  requirement: !ruby/object:Gem::Requirement
@@ -220,7 +224,7 @@ dependencies:
220
224
  - !ruby/object:Gem::Version
221
225
  version: '1.6'
222
226
  - !ruby/object:Gem::Dependency
223
- name: factory_girl
227
+ name: factory_bot
224
228
  requirement: !ruby/object:Gem::Requirement
225
229
  requirements:
226
230
  - - ">="
@@ -248,7 +252,7 @@ dependencies:
248
252
  - !ruby/object:Gem::Version
249
253
  version: '0'
250
254
  - !ruby/object:Gem::Dependency
251
- name: appraisal
255
+ name: rubocop_challenger
252
256
  requirement: !ruby/object:Gem::Requirement
253
257
  requirements:
254
258
  - - ">="
@@ -261,32 +265,19 @@ dependencies:
261
265
  - - ">="
262
266
  - !ruby/object:Gem::Version
263
267
  version: '0'
264
- - !ruby/object:Gem::Dependency
265
- name: rubocop
266
- requirement: !ruby/object:Gem::Requirement
267
- requirements:
268
- - - "~>"
269
- - !ruby/object:Gem::Version
270
- version: 0.48.1
271
- type: :development
272
- prerelease: false
273
- version_requirements: !ruby/object:Gem::Requirement
274
- requirements:
275
- - - "~>"
276
- - !ruby/object:Gem::Version
277
- version: 0.48.1
278
268
  description: A pluggable webhook subscription system
279
- email: piotr@payrollhero.com
269
+ email: dev@payrollhero.com
280
270
  executables: []
281
271
  extensions: []
282
272
  extra_rdoc_files: []
283
273
  files:
284
274
  - ".codeclimate.yml"
275
+ - ".github/workflows/build.yml"
276
+ - ".github/workflows/rubocop-challenger.yml"
285
277
  - ".gitignore"
286
278
  - ".rubocop.hound.yml"
287
279
  - ".rubocop.yml"
288
- - ".travis.yml"
289
- - Appraisals
280
+ - ".rubocop_todo.yml"
290
281
  - CHANGELOG.md
291
282
  - DEPLOYING.md
292
283
  - Gemfile
@@ -294,9 +285,14 @@ files:
294
285
  - README.md
295
286
  - Rakefile
296
287
  - gemfiles/.bundle/config
297
- - gemfiles/rails_4.gemfile
298
- - gemfiles/rails_5.gemfile
299
- - gemfiles/rails_5_2.gemfile
288
+ - gemfiles/rails_4.2.gemfile
289
+ - gemfiles/rails_4.2.gemfile.lock
290
+ - gemfiles/rails_5.0.gemfile
291
+ - gemfiles/rails_5.1.gemfile
292
+ - gemfiles/rails_5.2.gemfile
293
+ - gemfiles/rails_6.0.gemfile
294
+ - gemfiles/rails_6.1.gemfile
295
+ - gemfiles/rails_7.0.gemfile
300
296
  - lib/webhook_system.rb
301
297
  - lib/webhook_system/base_event.rb
302
298
  - lib/webhook_system/encoder.rb
@@ -310,7 +306,13 @@ homepage: https://github.com/payrollhero/webhook_system
310
306
  licenses:
311
307
  - MIT
312
308
  metadata: {}
313
- post_install_message:
309
+ post_install_message: "\n ## Upgrading\n\n If you are upgrading from <= 2.3.1
310
+ into >= 2.4, then you must run a migration to rename the `encrypt` column.\n This
311
+ rename was required for adding support for Rails 7.\n\n You can use this migration.\n\n
312
+ \ ```ruby\n # db/migrate/20220427113942_rename_encrypt_on_webhook_subscriptions.rb\n
313
+ \ class RenameEncryptOnWebhookSubscriptions < ActiveRecord::Migration[7.0]\n def
314
+ change\n rename_column :webhook_subscriptions, :encrypt, :encrypted\n end\n
315
+ \ end\n ```\n "
314
316
  rdoc_options: []
315
317
  require_paths:
316
318
  - lib
@@ -325,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
325
327
  - !ruby/object:Gem::Version
326
328
  version: '0'
327
329
  requirements: []
328
- rubygems_version: 3.0.6
330
+ rubygems_version: 3.1.6
329
331
  signing_key:
330
332
  specification_version: 4
331
333
  summary: Webhook system
data/.travis.yml DELETED
@@ -1,23 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1.8
4
- - 2.2.4
5
- - 2.3.0
6
- - 2.5.3
7
- - 2.6.3
8
-
9
- gemfile:
10
- - gemfiles/rails_4.gemfile
11
- - gemfiles/rails_5.gemfile
12
- - gemfiles/rails_5_2.gemfile
13
-
14
- matrix:
15
- exclude:
16
- - rvm: 2.5.3
17
- gemfile: gemfiles/rails_4.gemfile
18
- - rvm: 2.1.8
19
- gemfile: gemfiles/rails_5.gemfile
20
- - rvm: 2.1.8
21
- gemfile: gemfiles/rails_5_2.gemfile
22
-
23
- script: "bundle exec rspec"
data/Appraisals DELETED
@@ -1,14 +0,0 @@
1
- appraise 'rails-4' do
2
- gem 'rails', '~> 4.2.11'
3
- gem 'sqlite3', '~> 1.3.6'
4
- end
5
-
6
- appraise 'rails-5' do
7
- gem 'rails', '~> 5.0.1'
8
- gem 'sqlite3', '~> 1.3.6'
9
- end
10
-
11
- appraise 'rails-5-2' do
12
- gem 'rails', '~> 5.2.1'
13
- gem 'sqlite3', '~> 1.4.1'
14
- end