8000 Double assignment is still needed to prevent an "unused variable" war… · rack/rack@f4c5645 · GitHub
[go: up one dir, main page]

Skip to content

Commit f4c5645

Browse files
kamipoioquatix
authored andcommitted
Double assignment is still needed to prevent an "unused variable" warning
That warning is still raised on latest Ruby.
1 parent 5c121dd commit f4c5645

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/rack/show_exceptions.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ def dump_exception(exception)
6363
def pretty(env, exception)
6464
req = Rack::Request.new(env)
6565

66-
# This double assignment is to prevent an "unused variable" warning on
67-
# Ruby 1.9.3. Yes, it is dumb, but I don't like Ruby yelling at me.
66+
# This double assignment is to prevent an "unused variable" warning.
67+
# Yes, it is dumb, but I don't like Ruby yelling at me.
6868
path = path = (req.script_name + req.path_info).squeeze("/")
6969

70-
# This double assignment is to prevent an "unused variable" warning on
71-
# Ruby 1.9.3. Yes, it is dumb, but I don't like Ruby yelling at me.
70+
# This double assignment is to prevent an "unused variable" warning.
71+
# Yes, it is dumb, but I don't like Ruby yelling at me.
7272
frames = frames = exception.backtrace.map { |line|
7373
frame = OpenStruct.new
7474
if line =~ /(.*?):(\d+)(:in `(.*)')?/

lib/rack/show_status.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ def call(env)
2323

2424
# client or server error, or explicit message
2525
if (status.to_i >= 400 && empty) || env[RACK_SHOWSTATUS_DETAIL]
26-
# This double assignment is to prevent an "unused variable" warning on
27-
# Ruby 1.9.3. Yes, it is dumb, but I don't like Ruby yelling at me.
26+
# This double assignment is to prevent an "unused variable" warning.
27+
# Yes, it is dumb, but I don't like Ruby yelling at me.
2828
req = req = Rack::Request.new(env)
2929

3030
message = Rack::Utils::HTTP_STATUS_CODES[status.to_i] || status.to_s
3131

32-
# This double assignment is to prevent an "unused variable" warning on
33-
# Ruby 1.9.3. Yes, it is dumb, but I don't like Ruby yelling at me.
32+
# This double assignment is to prevent an "unused variable" warning.
33+
# Yes, it is dumb, but I don't like Ruby yelling at me.
3434
detail = detail = env[RACK_SHOWSTATUS_DETAIL] || message
3535

3636
body = @template.result(binding)

0 commit comments

Comments
 (0)
0