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

erb.rb: Prevent potential unexpected rescue

of LoadError in some method calls, not from `require "strscan"`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2017-05-20 16:20:07 +00:00
parent 9aa33d5ddf
commit a6986f10d0

View file

@ -501,6 +501,8 @@ class ERB
begin
require 'strscan'
rescue LoadError
else
class SimpleScanner < Scanner # :nodoc:
def scan
stag_reg = /(.*?)(#{stags.join('|')}|\z)/m
@ -540,8 +542,6 @@ class ERB
end
end
Scanner.regist_scanner(ExplicitScanner, '-', false)
rescue LoadError
end
class Buffer # :nodoc: