Skip to content

Loading…

Remove warnings: 'not used variable' and 'shadowing outer variable' #487

Merged
merged 1 commit into from

2 participants

@carlosantoniodasilva

Got the following warning when running Rails tests:

rack-1.4.3/lib/rack/utils.rb:8: warning: assigned but unused variable - ruby_engine

The other warning was found when running rack own tests. I believe this can be safely applied to rack-1.4 branch - let me know if a pull request is necessary.

@raggi raggi merged commit 195054c into rack:master

1 check passed

Details default The Travis build passed
@raggi
Official Rack repositories member

Thanks

@carlosantoniodasilva carlosantoniodasilva deleted the carlosantoniodasilva:remove-warnings branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 1 addition and 2 deletions.
  1. +0 −1 lib/rack/utils.rb
  2. +1 −1 test/spec_lock.rb
View
1 lib/rack/utils.rb
@@ -5,7 +5,6 @@
require 'rack/multipart'
major, minor, patch = RUBY_VERSION.split('.').map { |v| v.to_i }
-ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
if major == 1 && minor < 9
require 'rack/backports/uri/common_18'
View
2 test/spec_lock.rb
@@ -139,7 +139,7 @@ def close; @close_called = true; end
should "unlock if the app throws" do
lock = Lock.new
env = Rack::MockRequest.env_for("/")
- app = lock_app(lambda {|env| throw :bacon }, lock)
+ app = lock_app(lambda {|_| throw :bacon }, lock)
lambda { app.call(env) }.should.throw(:bacon)
lock.synchronized.should.equal false
end
Something went wrong with that request. Please try again.