Permalink
Browse files

clarify variable name

  • Loading branch information...
1 parent 3a8f40f commit ebea208657b4d107fe3f45f13b0c54ea1a6ea48b @floere committed Mar 23, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/sinatra/base.rb
View
6 lib/sinatra/base.rb
@@ -1302,9 +1302,9 @@ def compile!(verb, path, block, options = {})
def compile(path)
keys = []
if path.respond_to? :to_str
- pad = []
+ ignore = ""
pattern = path.to_str.gsub(/[^\?\%\\\/\:\*\w]/) do |c|
- pad += escaped(c) if c.match(/[\.@]/)
+ ignore << escaped(c).join if c.match(/[\.@]/)
encoded(c)
end
pattern.gsub!(/((:\w+)|\*)/) do |match|
@@ -1313,7 +1313,7 @@ def compile(path)
"(.*?)"
else
keys << $2[1..-1]
- "([^#{pad.join}/?#]+)"
+ "([^#{ignore}/?#]+)"
end
end
[/^#{pattern}$/, keys]

0 comments on commit ebea208

Please sign in to comment.