clarify variable name

This commit is contained in:
Florian Hanke 2012-03-23 11:45:03 +11:00
parent 3a8f40f684
commit ebea208657
1 changed files with 3 additions and 3 deletions

View File

@ -1302,9 +1302,9 @@ module Sinatra
def compile(path) def compile(path)
keys = [] keys = []
if path.respond_to? :to_str if path.respond_to? :to_str
pad = [] ignore = ""
pattern = path.to_str.gsub(/[^\?\%\\\/\:\*\w]/) do |c| pattern = path.to_str.gsub(/[^\?\%\\\/\:\*\w]/) do |c|
pad += escaped(c) if c.match(/[\.@]/) ignore << escaped(c).join if c.match(/[\.@]/)
encoded(c) encoded(c)
end end
pattern.gsub!(/((:\w+)|\*)/) do |match| pattern.gsub!(/((:\w+)|\*)/) do |match|
@ -1313,7 +1313,7 @@ module Sinatra
"(.*?)" "(.*?)"
else else
keys << $2[1..-1] keys << $2[1..-1]
"([^#{pad.join}/?#]+)" "([^#{ignore}/?#]+)"
end end
end end
[/^#{pattern}$/, keys] [/^#{pattern}$/, keys]