From a6986f10d037a8ca5bee4416ad5f22c03b4ef930 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sat, 20 May 2017 16:20:07 +0000 Subject: [PATCH] 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 --- lib/erb.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/erb.rb b/lib/erb.rb index 3ff64cbb3d..b1c993c001 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -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: