зеркало из https://github.com/github/ruby.git
`/o` should not use with instance variable
for example: ``` class C;def initialize(pat);@pat=pat;end;def re;/#{@pat}/o;end;end C.new('1').re #=> /1/ C.new('2').re #=> /1/ ```
This commit is contained in:
Родитель
3805ef7fb5
Коммит
2e6f777f9e
|
@ -112,7 +112,7 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
|
||||||
# GET request entry point. Fills in +res+ for the path, etc. in +req+.
|
# GET request entry point. Fills in +res+ for the path, etc. in +req+.
|
||||||
|
|
||||||
def do_GET req, res
|
def do_GET req, res
|
||||||
req.path.sub!(/\A#{Regexp.escape @mount_path}/o, '') if @mount_path
|
req.path.sub!(/\A#{Regexp.escape @mount_path}/, '') if @mount_path
|
||||||
|
|
||||||
case req.path
|
case req.path
|
||||||
when '/' then
|
when '/' then
|
||||||
|
|
Загрузка…
Ссылка в новой задаче