1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

ruby >= 2.7 may raise NameError when const_getting the handler Erubi this way

https://bugs.ruby-lang.org/issues/15875#note-1
This commit is contained in:
Akira Matsuda 2019-05-25 09:32:37 +09:00
parent 9374849ce5
commit 09cb8efa1c

View file

@ -34,7 +34,7 @@ module Haml
# solved by looking for ::Erubi first.
# However, in JRuby, the const_defined? finds it anyway, so we must make sure that it's
# not just a reference to ::Erubi.
if defined?(::Erubi) && (Object.const_get('::ActionView::Template::Handlers::ERB::Erubi') != ::Erubi)
if defined?(::Erubi) && (::ActionView::Template::Handlers::ERB.const_get('Erubi') != ::Erubi)
require "haml/helpers/safe_erubi_template"
Haml::Filters::RailsErb.template_class = Haml::SafeErubiTemplate
else