1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

/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:
Kazuhiro NISHIYAMA 2019-07-30 12:44:38 +09:00
parent 3805ef7fb5
commit 2e6f777f9e
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A

View file

@ -112,7 +112,7 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
# GET request entry point. Fills in +res+ for the path, etc. in +req+.
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
when '/' then