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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b856ca96430e985e877986007588466ee8f9e88c28922bbe04cd11b3fdb4fbbd
4
- data.tar.gz: e81299bebd9725a6312de76d3fc4bd8adb73d518cbbd846d222309c6656b3430
3
+ metadata.gz: 40747828c1defde983b21428aac71e2ad6676b8d72002f2d0f02b98cf88d42ea
4
+ data.tar.gz: e95040aba8051a139313bfe0d3ba988ee34a8bd68ce5bed52fd12313d3fad123
5
5
  SHA512:
6
- metadata.gz: b855a60f92ba081cbce364d8c900106372370288a2683691c3f155ad7ad4a826a56e46ac024f253a9f64f212faabf88779c0b40b20ff709a1ec1780e7baebb83
7
- data.tar.gz: ffa8f6e7a854093c66c826bb4bbb5b32fec0e3daf120e8dc131590175af0a94181af8a494efdfd4232cf0d813aec4db34e73e8c78297dc678656066c855a35fa
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.0
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.0.2
1
+ 3.4.1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  # Unreleased
4
4
 
5
+ # 4.0.0 / 2025-01-15
6
+
7
+ * Drop support for Rails < 7.0 and Ruby < 3.0
8
+
5
9
  # 3.0.1 / 2022-03-09
6
10
 
7
11
  * [#120](https://github.com/gocardless/coach/pull/120) Fixes missing method from middleware in Rails 7
data/Gemfile CHANGED
@@ -4,4 +4,11 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
- gem "rails", "~> #{ENV['RAILS_VERSION']}" if ENV["RAILS_VERSION"]
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 2.6 and onwards.
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
- | Event | Arguments |
333
- |-------------------------------|------------------------------------------------------- |
334
- | `start_handler.coach` | `event(:middleware, :request)` |
335
- | `start_middleware.coach` | `event(:middleware, :request)` |
336
- | `finish_middleware.coach` | `start`, `finish`, `id`, `event(:middleware, :request)`|
337
- | `finish_handler.coach` | `start`, `finish`, `id`, `event(:middleware, :request)`|
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
- - Better formatting of provider chains
439
- - Outputting DOT format files to visualise with Graphviz
440
- - Editor integrations (e.g. showing the provider chains when hovering a `requires`
441
- statement)
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
- * Coach is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
446
- * Bug reports and pull requests are welcome on GitHub at https://github.com/gocardless/coach.
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 = ">= 2.6"
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", ">= 4.2"
23
- spec.add_dependency "activesupport", ">= 4.2"
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.add_development_dependency "gc_ruboconfig", "~> 2.18.0"
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
@@ -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 received an End of Life notice ([e.g. this notice for Ruby 2.1](https://www.ruby-lang.org/en/news/2017/04/01/support-of-ruby-2-1-has-ended/)) is supported. Similarly, any version of Rails listed as currently supported on [this page](http://guides.rubyonrails.org/maintenance_policy.html) is one we aim to support in Coach.
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](../.circleci/config.yml) includes all these versions.
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
 
@@ -44,7 +44,7 @@ module Coach
44
44
  raise err
45
45
  end
46
46
 
47
- chains.map { |chain| chain.map(&:to_s).reverse }.to_set
47
+ chains.to_set { |chain| chain.map(&:to_s).reverse }
48
48
  end
49
49
 
50
50
  private
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.
@@ -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.map do |key, value|
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.compact
72
+ end
73
73
 
74
- Hash[header_value_pairs]
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
- response = [name + config.except(:callback).inspect.to_s]
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
- "#{@response[0]}"
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
- "hash_including(#{keys})"
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
- "\"#{@header_value}\""
89
+ "\"#{@header_value}\""
88
90
  end
89
91
  end
90
92
 
data/lib/coach/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coach
4
- VERSION = "3.0.1"
4
+ VERSION = "4.0.0"
5
5
  end
@@ -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], # rubocop:disable Layout/LineLength
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(%w[A{} B{} Terminal{:handler=>true}])
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(%w[A{} B{} Terminal{:handler=>true}])
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("Coach::RequestSerializer", serialize: {}))
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 match_array([middleware_a, terminal_middleware])
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 match_array([middleware_c, middleware_b,
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 match_array([middleware_c, middleware_a,
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 match_array([middleware_c, middleware_a,
196
- middleware_c, middleware_b,
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(%w[A{} B{:b=>true} Terminal{}])
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(%w[A{} C{:b=>true} D{} B{:b=>true} Terminal{}])
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("Coach::RequestSerializer", serialize: {}))
15
+ and_return(instance_double(Coach::RequestSerializer, serialize: {}))
16
16
 
17
17
  ActiveSupport::Notifications.subscribe(/\.coach$/) do |name, *_, event|
18
18
  events << [name, event]
@@ -8,7 +8,7 @@ describe Coach::RequestBenchmark do
8
8
 
9
9
  let(:base_time) { Time.now }
10
10
 
11
- let(:start) { base_time + 0 }
11
+ let(:start) { base_time }
12
12
  let(:a_start) { base_time + 1 }
13
13
  let(:b_start) { base_time + 2 }
14
14
  let(:b_finish) { base_time + 3 }
@@ -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("ActionDispatch::Request", format: nil,
46
- remote_ip: nil,
47
- uuid: nil,
48
- method: nil,
49
- filtered_parameters: nil,
50
- filtered_env: filtered_env)
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("ActionDispatch::Routing::Mapper") }
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
- sort.
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: 3.0.1
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: 2022-03-09 00:00:00.000000000 Z
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: '4.2'
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: '4.2'
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: '4.2'
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: '4.2'
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
- post_install_message:
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: '2.6'
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.22
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'