coach 3.0.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +38 -0
- data/.rubocop.yml +11 -3
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +8 -1
- data/README.md +21 -24
- data/coach.gemspec +4 -10
- data/docs/COMPATIBILITY.md +2 -2
- data/lib/coach/cli/provider_finder.rb +1 -1
- data/lib/coach/handler.rb +0 -2
- data/lib/coach/notifications.rb +1 -3
- data/lib/coach/request_serializer.rb +3 -3
- data/lib/coach/rspec.rb +6 -4
- data/lib/coach/version.rb +1 -1
- data/spec/lib/coach/cli/provider_finder_spec.rb +1 -1
- data/spec/lib/coach/handler_spec.rb +10 -13
- data/spec/lib/coach/notifications_spec.rb +1 -1
- data/spec/lib/coach/request_benchmark_spec.rb +1 -1
- data/spec/lib/coach/request_serializer_spec.rb +6 -6
- data/spec/lib/coach/router_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- metadata +12 -110
- data/.circleci/config.yml +0 -64
- data/.rubocop_todo.yml +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40747828c1defde983b21428aac71e2ad6676b8d72002f2d0f02b98cf88d42ea
|
4
|
+
data.tar.gz: e95040aba8051a139313bfe0d3ba988ee34a8bd68ce5bed52fd12313d3fad123
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 709f3905a98cc77fa24ce96611a5a61469eb984c0b77307f6e74a02a87efd1b4dcb88caa1917bb80753efb6c4a2535bd694b85a98d7e6779dd5f3840167ba87f
|
7
|
+
data.tar.gz: 9ca316c7a3ce5bfc88053d2e8fc5004cc6b01bd069633290cd5ac4aa9e7cf25e6914a7c4098012f5136d62d7408949de84fbb7f939f846ec0d0db31e5c3356bb
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
rubocop:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v3
|
11
|
+
- name: Set up Ruby
|
12
|
+
uses: ruby/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
bundler-cache: true
|
15
|
+
- name: Run rubocop
|
16
|
+
run: bundle exec rubocop --parallel --extra-details --display-style-guide
|
17
|
+
|
18
|
+
tests:
|
19
|
+
strategy:
|
20
|
+
fail-fast: false
|
21
|
+
matrix:
|
22
|
+
ruby-version: ["3.1", "3.2", "3.3", "3.4"]
|
23
|
+
rails-version: ["7.0", "7.1", "7.2", "8.0"]
|
24
|
+
exclude:
|
25
|
+
- ruby-version: "3.1"
|
26
|
+
rails-version: "8.0"
|
27
|
+
runs-on: ubuntu-latest
|
28
|
+
env:
|
29
|
+
RAILS_VERSION: ${{ matrix.rails-version }}
|
30
|
+
steps:
|
31
|
+
- uses: actions/checkout@v3
|
32
|
+
- name: Set up Ruby
|
33
|
+
uses: ruby/setup-ruby@v1
|
34
|
+
with:
|
35
|
+
bundler-cache: true
|
36
|
+
ruby-version: "${{ matrix.ruby-version }}"
|
37
|
+
- name: Run tests
|
38
|
+
run: bundle exec rspec --format RSpec::Github::Formatter
|
data/.rubocop.yml
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
2
|
-
|
3
1
|
inherit_gem:
|
4
2
|
gc_ruboconfig: rubocop.yml
|
5
3
|
|
6
4
|
AllCops:
|
7
|
-
TargetRubyVersion: 3.
|
5
|
+
TargetRubyVersion: 3.1
|
6
|
+
NewCops: enable
|
8
7
|
|
9
8
|
Metrics/MethodLength:
|
10
9
|
Max: 15
|
@@ -29,3 +28,12 @@ Naming/MethodParameterName:
|
|
29
28
|
|
30
29
|
Gemspec/RequiredRubyVersion:
|
31
30
|
Enabled: False
|
31
|
+
|
32
|
+
RSpec/NestedGroups:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
RSpec/MultipleExpectations:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
RSpec/ExampleLength:
|
39
|
+
Max: 10
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.4.1
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -4,4 +4,11 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
|
7
|
+
group :development, :test do
|
8
|
+
gem "gc_ruboconfig", "~> 5"
|
9
|
+
gem "pry", "~> 0.10"
|
10
|
+
gem "rails", "~> #{ENV['RAILS_VERSION']}" if ENV["RAILS_VERSION"]
|
11
|
+
gem "rspec", "~> 3.13"
|
12
|
+
gem "rspec-github", "~> 2.4.0"
|
13
|
+
gem "rspec-its", "~> 1.2"
|
14
|
+
end
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Coach
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/coach.svg)](http://badge.fury.io/rb/coach)
|
4
|
-
[![CircleCI](https://circleci.com/gh/gocardless/coach.svg?style=svg)](https://circleci.com/gh/gocardless/coach)
|
5
|
-
[![Code Climate](https://codeclimate.com/github/gocardless/coach.svg)](https://codeclimate.com/github/gocardless/coach)
|
6
4
|
|
7
5
|
Coach improves your controller code by encouraging:
|
8
6
|
|
@@ -23,7 +21,7 @@ To get started, just add Coach to your `Gemfile`, and then run `bundle`:
|
|
23
21
|
gem 'coach'
|
24
22
|
```
|
25
23
|
|
26
|
-
Coach works with Ruby versions
|
24
|
+
Coach works with Ruby versions 3.1 and onwards.
|
27
25
|
|
28
26
|
## Coach by example
|
29
27
|
|
@@ -278,13 +276,13 @@ end
|
|
278
276
|
Default actions that conform to standard REST principles can be easily loaded, with the
|
279
277
|
users resource being mapped to:
|
280
278
|
|
281
|
-
| Method | URL | Description
|
282
|
-
|
283
|
-
| `GET` | `/users` | Index all users
|
284
|
-
| `GET` | `/users/:id` | Get user by ID
|
285
|
-
| `POST` | `/users` | Create new user
|
286
|
-
| `PUT` | `/users/:id` | Update user details
|
287
|
-
| `POST` | `/users/:id/actions/disable` | Custom action routed to the given path suffix
|
279
|
+
| Method | URL | Description |
|
280
|
+
| ------ | ---------------------------- | --------------------------------------------- |
|
281
|
+
| `GET` | `/users` | Index all users |
|
282
|
+
| `GET` | `/users/:id` | Get user by ID |
|
283
|
+
| `POST` | `/users` | Create new user |
|
284
|
+
| `PUT` | `/users/:id` | Update user details |
|
285
|
+
| `POST` | `/users/:id/actions/disable` | Custom action routed to the given path suffix |
|
288
286
|
|
289
287
|
If you're using Zeitwerk, you can pass the name of the module to `#draw`, instead of the module
|
290
288
|
itself.
|
@@ -328,14 +326,13 @@ middleware.
|
|
328
326
|
Information for how to use `ActiveSupport`s notifications can be found
|
329
327
|
[here](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html).
|
330
328
|
|
331
|
-
|
332
|
-
|
|
333
|
-
|
334
|
-
| `
|
335
|
-
| `
|
336
|
-
| `
|
337
|
-
| `
|
338
|
-
| `request.coach` | `event` containing request data and benchmarking |
|
329
|
+
| Event | Arguments |
|
330
|
+
| ------------------------- | ------------------------------------------------------- |
|
331
|
+
| `start_handler.coach` | `event(:middleware, :request)` |
|
332
|
+
| `start_middleware.coach` | `event(:middleware, :request)` |
|
333
|
+
| `finish_middleware.coach` | `start`, `finish`, `id`, `event(:middleware, :request)` |
|
334
|
+
| `finish_handler.coach` | `start`, `finish`, `id`, `event(:middleware, :request)` |
|
335
|
+
| `request.coach` | `event` containing request data and benchmarking |
|
339
336
|
|
340
337
|
Of special interest is `request.coach`, which publishes statistics on an entire
|
341
338
|
middleware chain and request. This data is particularly useful for logging, and is our
|
@@ -435,14 +432,14 @@ around 15s to 1s.
|
|
435
432
|
While we think the commands we've already built are useful, we do have some ideas to go
|
436
433
|
further, including:
|
437
434
|
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
435
|
+
- Better formatting of provider chains
|
436
|
+
- Outputting DOT format files to visualise with Graphviz
|
437
|
+
- Editor integrations (e.g. showing the provider chains when hovering a `requires`
|
438
|
+
statement)
|
442
439
|
|
443
440
|
# License & Contributing
|
444
441
|
|
445
|
-
|
446
|
-
|
442
|
+
- Coach is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
443
|
+
- Bug reports and pull requests are welcome on GitHub at https://github.com/gocardless/coach.
|
447
444
|
|
448
445
|
GoCardless ♥ open source. If you do too, come [join us](https://gocardless.com/about/jobs).
|
data/coach.gemspec
CHANGED
@@ -12,21 +12,15 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.homepage = "https://github.com/gocardless/coach"
|
13
13
|
spec.email = %w[developers@gocardless.com]
|
14
14
|
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">=
|
15
|
+
spec.required_ruby_version = ">= 3.1"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0")
|
18
|
-
spec.test_files = spec.files.grep(%r{^spec/})
|
19
18
|
spec.require_paths = ["lib"]
|
20
19
|
spec.executables = ["coach"]
|
21
20
|
|
22
|
-
spec.add_dependency "actionpack", ">=
|
23
|
-
spec.add_dependency "activesupport", ">=
|
21
|
+
spec.add_dependency "actionpack", ">= 7.0"
|
22
|
+
spec.add_dependency "activesupport", ">= 7.0"
|
24
23
|
spec.add_dependency "commander", "~> 4.5"
|
25
24
|
|
26
|
-
spec.
|
27
|
-
spec.add_development_dependency "pry", "~> 0.10"
|
28
|
-
spec.add_development_dependency "rspec", "~> 3.2"
|
29
|
-
spec.add_development_dependency "rspec-its", "~> 1.2"
|
30
|
-
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.0"
|
31
|
-
spec.add_development_dependency "rubocop", "~> 1.12"
|
25
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
32
26
|
end
|
data/docs/COMPATIBILITY.md
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
Our goal as Coach maintainers is for the library to be compatible with all supported versions of Ruby and Rails.
|
4
4
|
|
5
|
-
Specifically, any CRuby/MRI version that has not
|
5
|
+
Specifically, any CRuby/MRI version that has not reached (End of Life)[https://endoflife.date/ruby] is supported. Similarly, any version of Rails listed as currently supported on [this page](https://endoflife.date/rails) is one we aim to support in Coach.
|
6
6
|
|
7
|
-
To that end, [our build matrix](../.
|
7
|
+
To that end, [our build matrix](../.github/tests.yml) includes all these versions.
|
8
8
|
|
9
9
|
Any time Coach doesn't work on a supported combination of Ruby and Rails, it's a bug, and can be reported [here](https://github.com/gocardless/coach/issues).
|
10
10
|
|
data/lib/coach/handler.rb
CHANGED
@@ -25,7 +25,6 @@ module Coach
|
|
25
25
|
|
26
26
|
# The Rack interface to handler - builds a middleware chain based on
|
27
27
|
# the current request, and invokes it.
|
28
|
-
# rubocop:disable Metrics/MethodLength
|
29
28
|
def call(env)
|
30
29
|
context = { request: ActionDispatch::Request.new(env) }
|
31
30
|
sequence = build_sequence(root_item, context)
|
@@ -55,7 +54,6 @@ module Coach
|
|
55
54
|
)
|
56
55
|
end
|
57
56
|
end
|
58
|
-
# rubocop:enable Metrics/MethodLength
|
59
57
|
|
60
58
|
# Traverse the middlware tree to build a linear middleware sequence,
|
61
59
|
# containing only middlewares that apply to this request.
|
data/lib/coach/notifications.rb
CHANGED
@@ -46,9 +46,7 @@ module Coach
|
|
46
46
|
def unsubscribe!
|
47
47
|
return unless active?
|
48
48
|
|
49
|
-
while @subscriptions.any?
|
50
|
-
ActiveSupport::Notifications.unsubscribe(@subscriptions.pop)
|
51
|
-
end
|
49
|
+
ActiveSupport::Notifications.unsubscribe(@subscriptions.pop) while @subscriptions.any?
|
52
50
|
true
|
53
51
|
end
|
54
52
|
|
@@ -61,7 +61,7 @@ module Coach
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def filtered_headers
|
64
|
-
header_value_pairs = @request.filtered_env.
|
64
|
+
header_value_pairs = @request.filtered_env.filter_map do |key, value|
|
65
65
|
key = if RACK_UNPREFIXED_HEADERS.include?(key)
|
66
66
|
"http_#{key.downcase}"
|
67
67
|
elsif key.start_with?("HTTP_")
|
@@ -69,9 +69,9 @@ module Coach
|
|
69
69
|
end
|
70
70
|
|
71
71
|
[key, self.class.apply_header_rule(key, value)] if key
|
72
|
-
end
|
72
|
+
end
|
73
73
|
|
74
|
-
|
74
|
+
header_value_pairs.to_h
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
data/lib/coach/rspec.rb
CHANGED
@@ -17,7 +17,9 @@ def build_middleware(name)
|
|
17
17
|
config[:callback].call if config.include?(:callback)
|
18
18
|
log_metadata(**{ name.to_sym => true })
|
19
19
|
|
20
|
-
|
20
|
+
# Emulate newer hash syntax for older Ruby versions
|
21
|
+
hash_response = config.except(:callback).map { |k, v| "#{k}: #{v}" }.join(", ")
|
22
|
+
response = [name + "{#{hash_response}}"]
|
21
23
|
|
22
24
|
# Build up a list of middleware called, in the order they were called
|
23
25
|
if next_middleware
|
@@ -45,7 +47,7 @@ RSpec::Matchers.define :respond_with_status do |expected_status|
|
|
45
47
|
|
46
48
|
failure_message do |_actual|
|
47
49
|
"expected #{@middleware.class.name} to respond with #{expected_status} but got " \
|
48
|
-
|
50
|
+
"#{@response[0]}"
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
@@ -71,7 +73,7 @@ RSpec::Matchers.define :respond_with_envelope do |envelope, keys = []|
|
|
71
73
|
|
72
74
|
failure_message do |_actual|
|
73
75
|
"expected that \"#{@response}\" would have envelope \"#{envelope}\" that matches " \
|
74
|
-
|
76
|
+
"hash_including(#{keys})"
|
75
77
|
end
|
76
78
|
end
|
77
79
|
|
@@ -84,7 +86,7 @@ RSpec::Matchers.define :respond_with_header do |header, value_regex|
|
|
84
86
|
|
85
87
|
failure_message do |_actual|
|
86
88
|
"expected #{header} header in response to match #{value_regex} but found " \
|
87
|
-
|
89
|
+
"\"#{@header_value}\""
|
88
90
|
end
|
89
91
|
end
|
90
92
|
|
data/lib/coach/version.rb
CHANGED
@@ -201,7 +201,7 @@ describe Coach::Cli::ProviderFinder do
|
|
201
201
|
expect(provider_finder.find_chain).
|
202
202
|
to eq([
|
203
203
|
%w[FirstProvidingMiddleware FirstIntermediateMiddleware RequiringMiddleware],
|
204
|
-
%w[SecondProvidingMiddleware SecondIntermediateMiddleware RequiringMiddleware],
|
204
|
+
%w[SecondProvidingMiddleware SecondIntermediateMiddleware RequiringMiddleware],
|
205
205
|
].to_set)
|
206
206
|
end
|
207
207
|
end
|
@@ -32,7 +32,7 @@ describe Coach::Handler do
|
|
32
32
|
expect(a_double).to receive(:call)
|
33
33
|
expect(b_double).to receive(:call)
|
34
34
|
result = handler.call({})
|
35
|
-
expect(result).to eq(
|
35
|
+
expect(result).to eq(["A{}", "B{}", "Terminal{handler: true}"])
|
36
36
|
end
|
37
37
|
|
38
38
|
context "with an invalid chain" do
|
@@ -66,7 +66,7 @@ describe Coach::Handler do
|
|
66
66
|
|
67
67
|
result = handler.call({})
|
68
68
|
|
69
|
-
expect(result).to eq(
|
69
|
+
expect(result).to eq(["A{}", "B{}", "Terminal{handler: true}"])
|
70
70
|
end
|
71
71
|
|
72
72
|
context "with an invalid chain" do
|
@@ -103,7 +103,7 @@ describe Coach::Handler do
|
|
103
103
|
# Prevent RequestSerializer from erroring due to insufficient request mock
|
104
104
|
allow(Coach::RequestSerializer).
|
105
105
|
to receive(:new).
|
106
|
-
and_return(instance_double(
|
106
|
+
and_return(instance_double(Coach::RequestSerializer, serialize: {}))
|
107
107
|
end
|
108
108
|
|
109
109
|
it { is_expected.to include("start_handler.coach") }
|
@@ -158,7 +158,7 @@ describe Coach::Handler do
|
|
158
158
|
before { terminal_middleware.uses(middleware_a) }
|
159
159
|
|
160
160
|
it "assembles a sequence including all middleware" do
|
161
|
-
expect(sequence).to
|
161
|
+
expect(sequence).to contain_exactly(middleware_a, terminal_middleware)
|
162
162
|
end
|
163
163
|
end
|
164
164
|
|
@@ -170,8 +170,7 @@ describe Coach::Handler do
|
|
170
170
|
end
|
171
171
|
|
172
172
|
it "assembles a sequence including all middleware" do
|
173
|
-
expect(sequence).to
|
174
|
-
middleware_a, terminal_middleware])
|
173
|
+
expect(sequence).to contain_exactly(middleware_c, middleware_b, middleware_a, terminal_middleware)
|
175
174
|
end
|
176
175
|
end
|
177
176
|
|
@@ -184,17 +183,15 @@ describe Coach::Handler do
|
|
184
183
|
end
|
185
184
|
|
186
185
|
it "only appears once" do
|
187
|
-
expect(sequence).to
|
188
|
-
middleware_b, terminal_middleware])
|
186
|
+
expect(sequence).to contain_exactly(middleware_c, middleware_a, middleware_b, terminal_middleware)
|
189
187
|
end
|
190
188
|
|
191
189
|
context "with a different config" do
|
192
190
|
before { middleware_b.uses(middleware_c, foo: "bar") }
|
193
191
|
|
194
192
|
it "appears more than once" do
|
195
|
-
expect(sequence).to
|
196
|
-
|
197
|
-
terminal_middleware])
|
193
|
+
expect(sequence).to contain_exactly(middleware_c, middleware_a, middleware_c, middleware_b,
|
194
|
+
terminal_middleware)
|
198
195
|
end
|
199
196
|
end
|
200
197
|
end
|
@@ -218,7 +215,7 @@ describe Coach::Handler do
|
|
218
215
|
|
219
216
|
it "sets up the chain correctly, calling each item in the correct order" do
|
220
217
|
expect(handler.build_request_chain(sequence, {}).call).
|
221
|
-
to eq(
|
218
|
+
to eq(["A{}", "B{b: true}", "Terminal{}"])
|
222
219
|
end
|
223
220
|
|
224
221
|
context "with inheriting config" do
|
@@ -229,7 +226,7 @@ describe Coach::Handler do
|
|
229
226
|
|
230
227
|
it "calls lambda with parent middlewares config" do
|
231
228
|
expect(handler.build_request_chain(sequence, {}).call).
|
232
|
-
to eq(
|
229
|
+
to eq(["A{}", "C{b: true}", "D{}", "B{b: true}", "Terminal{}"])
|
233
230
|
end
|
234
231
|
end
|
235
232
|
end
|
@@ -12,7 +12,7 @@ describe Coach::Notifications do
|
|
12
12
|
# Remove need to fully mock a request object
|
13
13
|
allow(Coach::RequestSerializer).
|
14
14
|
to receive(:new).
|
15
|
-
and_return(instance_double(
|
15
|
+
and_return(instance_double(Coach::RequestSerializer, serialize: {}))
|
16
16
|
|
17
17
|
ActiveSupport::Notifications.subscribe(/\.coach$/) do |name, *_, event|
|
18
18
|
events << [name, event]
|
@@ -42,12 +42,12 @@ describe Coach::RequestSerializer do
|
|
42
42
|
subject(:request_serializer) { described_class.new(mock_request) }
|
43
43
|
|
44
44
|
let(:mock_request) do
|
45
|
-
instance_double(
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
instance_double(ActionDispatch::Request, format: nil,
|
46
|
+
remote_ip: nil,
|
47
|
+
uuid: nil,
|
48
|
+
method: nil,
|
49
|
+
filtered_parameters: nil,
|
50
|
+
filtered_env: filtered_env)
|
51
51
|
end
|
52
52
|
|
53
53
|
let(:filtered_env) do
|
@@ -8,7 +8,7 @@ require "coach/handler"
|
|
8
8
|
describe Coach::Router do
|
9
9
|
subject(:router) { described_class.new(mapper) }
|
10
10
|
|
11
|
-
let(:mapper) { instance_double(
|
11
|
+
let(:mapper) { instance_double(ActionDispatch::Routing::Mapper) }
|
12
12
|
|
13
13
|
let(:routes) { %i[Index Show Create Update Destroy Refund] }
|
14
14
|
let(:resource_routes) { Routes::Thing }
|
data/spec/spec_helper.rb
CHANGED
@@ -5,8 +5,8 @@ require "pry"
|
|
5
5
|
require "coach"
|
6
6
|
require "coach/rspec"
|
7
7
|
|
8
|
-
Dir[Pathname(__FILE__).dirname.join("support", "**", "*.rb")]
|
9
|
-
|
8
|
+
Dir[Pathname(__FILE__).dirname.join("support", "**", "*.rb")]
|
9
|
+
.
|
10
10
|
each { |path| require path }
|
11
11
|
|
12
12
|
RSpec.configure do |config|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coach
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-15 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: actionpack
|
@@ -16,28 +15,28 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
18
|
+
version: '7.0'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
25
|
+
version: '7.0'
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
27
|
name: activesupport
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
32
|
+
version: '7.0'
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - ">="
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
39
|
+
version: '7.0'
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
41
|
name: commander
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,91 +51,6 @@ dependencies:
|
|
52
51
|
- - "~>"
|
53
52
|
- !ruby/object:Gem::Version
|
54
53
|
version: '4.5'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: gc_ruboconfig
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 2.18.0
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 2.18.0
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: pry
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0.10'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0.10'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rspec
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '3.2'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '3.2'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rspec-its
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '1.2'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '1.2'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rspec_junit_formatter
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 0.4.0
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 0.4.0
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rubocop
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '1.12'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '1.12'
|
139
|
-
description:
|
140
54
|
email:
|
141
55
|
- developers@gocardless.com
|
142
56
|
executables:
|
@@ -144,12 +58,11 @@ executables:
|
|
144
58
|
extensions: []
|
145
59
|
extra_rdoc_files: []
|
146
60
|
files:
|
147
|
-
- ".circleci/config.yml"
|
148
61
|
- ".github/dependabot.yml"
|
62
|
+
- ".github/workflows/tests.yml"
|
149
63
|
- ".gitignore"
|
150
64
|
- ".rspec"
|
151
65
|
- ".rubocop.yml"
|
152
|
-
- ".rubocop_todo.yml"
|
153
66
|
- ".ruby-version"
|
154
67
|
- CHANGELOG.md
|
155
68
|
- Gemfile
|
@@ -186,8 +99,8 @@ files:
|
|
186
99
|
homepage: https://github.com/gocardless/coach
|
187
100
|
licenses:
|
188
101
|
- MIT
|
189
|
-
metadata:
|
190
|
-
|
102
|
+
metadata:
|
103
|
+
rubygems_mfa_required: 'true'
|
191
104
|
rdoc_options: []
|
192
105
|
require_paths:
|
193
106
|
- lib
|
@@ -195,25 +108,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
195
108
|
requirements:
|
196
109
|
- - ">="
|
197
110
|
- !ruby/object:Gem::Version
|
198
|
-
version: '
|
111
|
+
version: '3.1'
|
199
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
113
|
requirements:
|
201
114
|
- - ">="
|
202
115
|
- !ruby/object:Gem::Version
|
203
116
|
version: '0'
|
204
117
|
requirements: []
|
205
|
-
rubygems_version: 3.2
|
206
|
-
signing_key:
|
118
|
+
rubygems_version: 3.6.2
|
207
119
|
specification_version: 4
|
208
120
|
summary: Alternative controllers built with middleware
|
209
|
-
test_files:
|
210
|
-
- spec/lib/coach/cli/provider_finder_spec.rb
|
211
|
-
- spec/lib/coach/handler_spec.rb
|
212
|
-
- spec/lib/coach/middleware_spec.rb
|
213
|
-
- spec/lib/coach/middleware_validator_spec.rb
|
214
|
-
- spec/lib/coach/notifications_spec.rb
|
215
|
-
- spec/lib/coach/request_benchmark_spec.rb
|
216
|
-
- spec/lib/coach/request_serializer_spec.rb
|
217
|
-
- spec/lib/coach/router_spec.rb
|
218
|
-
- spec/spec_helper.rb
|
219
|
-
- spec/support/routes.rb
|
121
|
+
test_files: []
|
data/.circleci/config.yml
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
---
|
2
|
-
version: 2.1
|
3
|
-
|
4
|
-
references:
|
5
|
-
bundle_install: &bundle_install
|
6
|
-
run:
|
7
|
-
name: Bundle
|
8
|
-
command: |
|
9
|
-
gem install bundler --no-document && \
|
10
|
-
bundle config set no-cache 'true' && \
|
11
|
-
bundle config set jobs '4' && \
|
12
|
-
bundle config set retry '3' && \
|
13
|
-
bundle install
|
14
|
-
|
15
|
-
cache_bundle: &cache_bundle
|
16
|
-
save_cache:
|
17
|
-
key: bundle-<< parameters.ruby_version >>-<< parameters.rails_version >>-{{ checksum "coach.gemspec" }}-{{ checksum "Gemfile" }}
|
18
|
-
paths:
|
19
|
-
- vendor/bundle
|
20
|
-
|
21
|
-
restore_bundle: &restore_bundle
|
22
|
-
restore_cache:
|
23
|
-
key: bundle-<< parameters.ruby_version >>-<< parameters.rails_version >>-{{ checksum "coach.gemspec" }}-{{ checksum "Gemfile" }}
|
24
|
-
|
25
|
-
jobs:
|
26
|
-
rspec:
|
27
|
-
working_directory: /mnt/ramdisk
|
28
|
-
parameters:
|
29
|
-
ruby_version:
|
30
|
-
type: string
|
31
|
-
rails_version:
|
32
|
-
type: string
|
33
|
-
docker:
|
34
|
-
- image: cimg/ruby:<< parameters.ruby_version >>
|
35
|
-
environment:
|
36
|
-
CIRCLE_TEST_REPORTS: /tmp/circle_artifacts/
|
37
|
-
steps:
|
38
|
-
- add_ssh_keys
|
39
|
-
- checkout
|
40
|
-
- *restore_bundle
|
41
|
-
- *bundle_install
|
42
|
-
- *cache_bundle
|
43
|
-
- run:
|
44
|
-
name: Run specs
|
45
|
-
command: |
|
46
|
-
bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) --profile --format progress --format RspecJunitFormatter -o /tmp/circle_artifacts/rspec.xml
|
47
|
-
- run:
|
48
|
-
name: "Rubocop"
|
49
|
-
command: bundle exec rubocop --extra-details --display-style-guide --parallel --force-exclusion
|
50
|
-
- store_artifacts:
|
51
|
-
path: /tmp/circle_artifacts/
|
52
|
-
- store_test_results:
|
53
|
-
path: /tmp/circle_artifacts/
|
54
|
-
|
55
|
-
workflows:
|
56
|
-
version: 2
|
57
|
-
tests:
|
58
|
-
jobs:
|
59
|
-
- rspec:
|
60
|
-
matrix:
|
61
|
-
parameters:
|
62
|
-
ruby_version: ["2.6", "2.7", "3.0"]
|
63
|
-
rails_version: ["5.2.6", "6.0.4", "6.1.4"]
|
64
|
-
|
data/.rubocop_todo.yml
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2018-03-08 12:21:23 +0000 using RuboCop version 0.53.0.
|
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
|
-
# Configuration parameters: Max.
|
11
|
-
RSpec/ExampleLength:
|
12
|
-
Exclude:
|
13
|
-
- 'spec/lib/coach/notifications_spec.rb'
|
14
|
-
|
15
|
-
# Offense count: 5
|
16
|
-
# Configuration parameters: AggregateFailuresByDefault.
|
17
|
-
RSpec/MultipleExpectations:
|
18
|
-
Max: 3
|
19
|
-
|
20
|
-
# Offense count: 12
|
21
|
-
# Configuration parameters: Max.
|
22
|
-
RSpec/NestedGroups:
|
23
|
-
Exclude:
|
24
|
-
- 'spec/lib/coach/handler_spec.rb'
|
25
|
-
- 'spec/lib/coach/middleware_validator_spec.rb'
|
26
|
-
- 'spec/lib/coach/request_serializer_spec.rb'
|
27
|
-
- 'spec/lib/coach/router_spec.rb'
|