Skip to content

Commit b792715

Browse files
committed
Merge pull request #978 from u2/rubocop0.29.1
Upgraded RuboCop to 0.29.1
2 parents 833cfe8 + 639ab88 commit b792715

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
33
gemspec
44

55
group :development, :test do
6-
gem 'rubocop', '~> 0.28.0'
6+
gem 'rubocop', '~> 0.29.1'
77
gem 'guard'
88
gem 'guard-rspec'
99
gem 'guard-rubocop'

lib/grape/dsl/configuration.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ def stacked_hash_to_hash(settings)
4848
def desc_container
4949
Module.new do
5050
include Grape::Util::StrictHashConfiguration.module(
51-
:description,
52-
:detail,
53-
:params,
54-
:entity,
55-
:http_codes,
56-
:named,
57-
:headers
51+
:description,
52+
:detail,
53+
:params,
54+
:entity,
55+
:http_codes,
56+
:named,
57+
:headers
5858
)
5959

6060
def config_context.success(*args)

lib/grape/dsl/routing.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ def mount(mounts)
8989
end
9090

9191
endpoints << Grape::Endpoint.new(
92-
in_setting,
93-
method: :any,
94-
path: path,
95-
app: app,
96-
for: self
92+
in_setting,
93+
method: :any,
94+
path: path,
95+
app: app,
96+
for: self
9797
)
9898
end
9999
end

lib/grape/endpoint.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@ def prepare_routes
151151
request_method = (method.to_s.upcase unless method == :any)
152152

153153
Route.new(options[:route_options].clone.merge(
154-
prefix: namespace_inheritable(:root_prefix),
155-
version: namespace_inheritable(:version) ? namespace_inheritable(:version).join('|') : nil,
156-
namespace: namespace,
157-
method: request_method,
158-
path: prepared_path,
159-
params: prepare_routes_path_params(path),
160-
compiled: path,
161-
settings: inheritable_setting.route.except(:saved_declared_params, :saved_validations)
154+
prefix: namespace_inheritable(:root_prefix),
155+
version: namespace_inheritable(:version) ? namespace_inheritable(:version).join('|') : nil,
156+
namespace: namespace,
157+
method: request_method,
158+
path: prepared_path,
159+
params: prepare_routes_path_params(path),
160+
compiled: path,
161+
settings: inheritable_setting.route.except(:saved_declared_params, :saved_validations)
162162
))
163163
end
164164
end.flatten

spec/grape/api_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def subject.enable_root_route!
419419
send verb, '/', MultiJson.dump(object), 'CONTENT_TYPE' => 'application/json'
420420
expect(last_response.status).to eq(verb == :post ? 201 : 200)
421421
expect(last_response.body).to eql MultiJson.dump(object)
422-
expect(last_request.params).to eql Hash.new
422+
expect(last_request.params).to eql({})
423423
end
424424
it 'stores input in api.request.input' do
425425
subject.format :json

spec/grape/endpoint_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ def app
116116
it 'includes request headers' do
117117
get '/headers'
118118
expect(JSON.parse(last_response.body)).to eq(
119-
'Host' => 'example.org',
120-
'Cookie' => ''
119+
'Host' => 'example.org',
120+
'Cookie' => ''
121121
)
122122
end
123123
it 'includes additional request headers' do

spec/grape/entity_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def first
114114

115115
it 'does not run autodetection for Entity when explicitely provided' do
116116
entity = Class.new(Grape::Entity)
117-
some_array = Array.new
117+
some_array = []
118118

119119
subject.get '/example' do
120120
present some_array, with: entity

0 commit comments

Comments
 (0)