Skip to content

Commit 3b751bd

Browse files
committed
Format code via rubocop
1 parent 61881a2 commit 3b751bd

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

benchmarks/benchmarks.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
]
2121

2222
glob = ARGV[0] || './apps/*.ru'
23-
apps = Dir[glob].each_with_object({}) do |config, hash|
24-
hash[config] = Rack::Builder.parse_file(config)
23+
apps = Dir[glob].to_h do |config|
24+
[config, Rack::Builder.parse_file(config)]
2525
end
2626
apps.freeze
2727

bin/update

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
Dir.glob('Gemfile*')
66
.reject { _1.end_with?('.lock') }
77
.each do |filename|
8-
puts `BUNDLE_GEMFILE=#{filename} bundle update`
8+
puts `BUNDLE_GEMFILE=#{filename} bundle update`
99
end
1010
puts `cd benchmarks && bundle update && cd ..`

lib/openapi_first.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def self.clear_cache!
2727
FileLoader.clear_cache!
2828
end
2929

30-
3130
# @return [Configuration]
3231
def self.configuration
3332
@configuration ||= Configuration.new

spec/router/find_content_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
end
1313

1414
let(:contents) do
15-
requests.each_with_object({}) do |req, hash|
16-
hash[req.content_type] = req
15+
requests.to_h do |req|
16+
[req.content_type, req]
1717
end
1818
end
1919

@@ -40,14 +40,14 @@
4040

4141
it 'finds */* wildcard matcher' do
4242
requests = [double(content_type: 'application/json'), double(content_type: '*/*')]
43-
contents = requests.each_with_object({}) { |req, m| m[req.content_type] = req }
43+
contents = requests.to_h { |req| [req.content_type, req] }
4444
expect(described_class.call(contents, 'some/foobar').content_type).to eq('*/*')
4545
expect(described_class.call(contents, 'some/foobar; Chartset=utf8').content_type).to eq('*/*')
4646
end
4747

4848
it 'finds a match if content_type is not defined' do
4949
requests = [double(content_type: 'application/json'), double(content_type: nil)]
50-
contents = requests.each_with_object({}) { |req, m| m[req.content_type] = req }
50+
contents = requests.to_h { |req| [req.content_type, req] }
5151
expect(described_class.call(contents, 'some/foobar')).to be(requests[1])
5252
end
5353
end

0 commit comments

Comments
 (0)