clarify variable name
This commit is contained in:
parent
3a8f40f684
commit
ebea208657
|
@ -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]
|
||||||
|
|
Loading…
Reference in New Issue