diff --git a/.rubocop.yml b/.rubocop.yml index 3e2f35dc..ca4bdf59 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,6 @@ AllCops: DisabledByDefault: true - TargetRubyVersion: 1.9.3 + TargetRubyVersion: 2.2 DisplayCopNames: true StyleGuideCopsOnly: false Exclude: @@ -51,41 +51,5 @@ Style/MethodDefParentheses: Style/TrailingCommaInArguments: Enabled: true -Performance/Count: - Enabled: true - -Performance/Detect: - Enabled: true - -Performance/EndWith: - Enabled: true - -Performance/FlatMap: - Enabled: true - -Performance/HashEachMethods: - Enabled: true - -Performance/RangeInclude: - Enabled: true - -Performance/RedundantMerge: - Enabled: true - -Performance/RedundantSortBy: - Enabled: true - -Performance/ReverseEach: - Enabled: true - -Performance/Sample: - Enabled: true - -Performance/Size: - Enabled: true - -Performance/StartWith: - Enabled: true - -Performance/TimesMap: +Performance: Enabled: true diff --git a/lib/puma/dsl.rb b/lib/puma/dsl.rb index 220c4f73..0ac577d7 100644 --- a/lib/puma/dsl.rb +++ b/lib/puma/dsl.rb @@ -493,7 +493,7 @@ module Puma when Hash if hdr = val[:header] @options[:remote_address] = :header - @options[:remote_address_header] = "HTTP_" + hdr.upcase.gsub("-", "_") + @options[:remote_address_header] = "HTTP_" + hdr.upcase.tr("-", "_") else raise "Invalid value for set_remote_address - #{val.inspect}" end diff --git a/lib/puma/rack/builder.rb b/lib/puma/rack/builder.rb index 7676ad54..301da500 100644 --- a/lib/puma/rack/builder.rb +++ b/lib/puma/rack/builder.rb @@ -110,7 +110,7 @@ module Puma::Rack has_options = false server.valid_options.each do |name, description| - next if name.to_s.match(/^(Host|Port)[^a-zA-Z]/) # ignore handler's host and port options, we do our own. + next if name.to_s =~ /^(Host|Port)[^a-zA-Z]/ # ignore handler's host and port options, we do our own. info << " -O %-21s %s" % [name, description] has_options = true end diff --git a/test/test_integration.rb b/test/test_integration.rb index 49cc99a4..e13330af 100644 --- a/test/test_integration.rb +++ b/test/test_integration.rb @@ -181,7 +181,7 @@ class TestIntegration < Minitest::Test until done @events.stdout.rewind log = @events.stdout.readlines.join("") - if log.match(/- Worker \d \(pid: \d+\) booted, phase: 1/) + if log =~ /- Worker \d \(pid: \d+\) booted, phase: 1/ assert_match(/TERM sent/, log) assert_match(/- Worker \d \(pid: \d+\) booted, phase: 1/, log) done = true diff --git a/test/test_puma_server_ssl.rb b/test/test_puma_server_ssl.rb index d479203f..147ee3de 100644 --- a/test/test_puma_server_ssl.rb +++ b/test/test_puma_server_ssl.rb @@ -144,7 +144,7 @@ class TestPumaServerSSLClient < Minitest::Test http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE - blk.call(http) + yield(http) client_error = false begin