Skip to content

Commit 54d4ce2

Browse files
committed
Satisfy rubocop on 2.3
1 parent 7bae986 commit 54d4ce2

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
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
ruby_version = RUBY_VERSION.to_f
6-
rubocop_platform = [:ruby_20, :ruby_21, :ruby_22]
6+
rubocop_platform = [:ruby_20, :ruby_21, :ruby_22, :ruby_23]
77
rubocop_platform = [:ruby_20, :ruby_21] if ruby_version < 2.0
88

99
group :test do

lib/rack_reverse_proxy/rule.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ def substitute(url)
153153
end
154154

155155
def transform(response, request_uri)
156-
found.inject(response) do |response, match|
156+
found.inject(response) do |accumulator, match|
157157
if match.respond_to?(:transform)
158-
match.transform(response, request_uri)
158+
match.transform(accumulator, request_uri)
159159
else
160-
response
160+
accumulator
161161
end
162162
end
163163
end

spec/rack/reverse_proxy_spec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,18 +586,19 @@ def app
586586
describe "with a matching and transforming class" do
587587
#:nodoc:
588588
class MatcherAndTransformer
589-
def self.match(path)
589+
def self.match(_path)
590590
MatcherAndTransformer.new
591591
end
592592

593-
def url(path)
593+
def url(_path)
594594
"http://example.org/redirecting"
595595
end
596596

597597
def transform(response, request_uri)
598598
status, headers, body = response
599599
location = headers["Location"]
600-
headers["Location"] = "?url=" + CGI.escape(location) + "&request_uri=" + CGI.escape(request_uri.to_s)
600+
headers["Location"] = "?url=" + CGI.escape(location) +
601+
"&request_uri=" + CGI.escape(request_uri.to_s)
601602
[status, headers, body]
602603
end
603604
end
@@ -617,7 +618,8 @@ def app
617618

618619
get "/"
619620
expect(last_response.headers["Location"])
620-
.to eq("?url=http%3A%2F%2Fexample.org%2Ftarget&request_uri=http%3A%2F%2Fexample.org%2Fredirecting")
621+
.to eq("?url=http%3A%2F%2Fexample.org%2Ftarget" \
622+
"&request_uri=http%3A%2F%2Fexample.org%2Fredirecting")
621623
end
622624
end
623625

0 commit comments

Comments
 (0)