Skip to content

Commit 289d945

Browse files
committed
Autocorrect rubocop since running on ruby 2.7
1 parent bd6feed commit 289d945

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,6 @@ Naming/VariableNumber:
127127
- 'spec/grape/exceptions/validation_errors_spec.rb'
128128
- 'spec/grape/validations_spec.rb'
129129

130-
# Offense count: 1
131-
# This cop supports safe autocorrection (--autocorrect).
132-
Performance/BindCall:
133-
Exclude:
134-
- 'lib/grape/endpoint.rb'
135-
136130
# Offense count: 4
137131
RSpec/AnyInstance:
138132
Exclude:
@@ -606,14 +600,6 @@ RSpec/VoidExpect:
606600
- 'spec/grape/api_spec.rb'
607601
- 'spec/grape/dsl/headers_spec.rb'
608602

609-
# Offense count: 6
610-
# This cop supports safe autocorrection (--autocorrect).
611-
# Configuration parameters: AllowOnlyRestArgument.
612-
Style/ArgumentsForwarding:
613-
Exclude:
614-
- 'lib/grape/api.rb'
615-
- 'lib/grape/endpoint.rb'
616-
617603
# Offense count: 1
618604
Style/CombinableLoops:
619605
Exclude:

lib/grape/api.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class << self
2626
attr_accessor :base_instance, :instances
2727

2828
# Rather than initializing an object of type Grape::API, create an object of type Instance
29-
def new(*args, &block)
30-
base_instance.new(*args, &block)
29+
def new(...)
30+
base_instance.new(...)
3131
end
3232

3333
# When inherited, will create a list of all instances (times the API was mounted)
@@ -77,8 +77,8 @@ def configure
7777
# the headers, and the body. See [the rack specification]
7878
# (http://www.rubydoc.info/github/rack/rack/master/file/SPEC) for more.
7979
# NOTE: This will only be called on an API directly mounted on RACK
80-
def call(*args, &block)
81-
instance_for_rack.call(*args, &block)
80+
def call(...)
81+
instance_for_rack.call(...)
8282
end
8383

8484
# Alleviates problems with autoloading by tring to search for the constant

lib/grape/endpoint.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class Endpoint
1313
attr_reader :env, :request, :headers, :params
1414

1515
class << self
16-
def new(*args, &block)
17-
self == Endpoint ? Class.new(Endpoint).new(*args, &block) : super
16+
def new(...)
17+
self == Endpoint ? Class.new(Endpoint).new(...) : super
1818
end
1919

2020
def before_each(new_setup = false, &block)
@@ -55,7 +55,7 @@ def generate_api_method(method_name, &block)
5555

5656
proc do |endpoint_instance|
5757
ActiveSupport::Notifications.instrument('endpoint_render.grape', endpoint: endpoint_instance) do
58-
method.bind(endpoint_instance).call
58+
method.bind_call(endpoint_instance)
5959
end
6060
end
6161
end

0 commit comments

Comments
 (0)