Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix 1.9.3 warnings

  • Loading branch information...
commit 79c145435c1e16bb690aad31fb50addaecc78252 1 parent a5ef8c5
Joshua Peek authored
5 lib/rack/mount/code_generation.rb
View
@@ -71,8 +71,11 @@ def optimized_each(obj)
def optimize_recognize!
Utils.debug "optimizing recognize"
+ uses_cache = false
+
keys = @recognition_keys.map { |key|
if key.respond_to?(:call_source)
+ uses_cache = true
key.call_source(:cache, :obj)
else
"obj.#{key}"
@@ -85,7 +88,7 @@ def optimize_recognize!
instance_eval(<<-RUBY, __FILE__, __LINE__)
def recognize(obj)
- cache = {}
+ #{"cache = {}" if uses_cache}
container = @recognition_graph[#{keys}]
optimize_container_iterator(container) unless container.respond_to?(:optimized_each)
2  lib/rack/mount/route.rb
View
@@ -82,7 +82,7 @@ def prefix?
def generation_keys
- @conditions.inject({}) { |keys, (method, condition)|
+ @conditions.inject({}) { |keys, (_, condition)|
if condition.respond_to?(:required_defaults)
keys.merge!(condition.required_defaults)
else
2  test/abstract_unit.rb
View
@@ -26,7 +26,7 @@ def routing_args
def assert_recognizes(params, path)
req = Rack::Request.new(Rack::MockRequest.env_for(path))
- _, actual_matches, actual_params = @app.recognize(req)
+ _, _, actual_params = @app.recognize(req)
assert_equal(params, actual_params)
end
Please sign in to comment.
Something went wrong with that request. Please try again.