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:
parent
9374849ce5
commit
09cb8efa1c
1 changed files with 1 additions and 1 deletions
|
@ -34,7 +34,7 @@ module Haml
|
||||||
# solved by looking for ::Erubi first.
|
# solved by looking for ::Erubi first.
|
||||||
# However, in JRuby, the const_defined? finds it anyway, so we must make sure that it's
|
# However, in JRuby, the const_defined? finds it anyway, so we must make sure that it's
|
||||||
# not just a reference to ::Erubi.
|
# 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"
|
require "haml/helpers/safe_erubi_template"
|
||||||
Haml::Filters::RailsErb.template_class = Haml::SafeErubiTemplate
|
Haml::Filters::RailsErb.template_class = Haml::SafeErubiTemplate
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue