Skip to content

Commit b8db70d

Browse files
committed
Skip using the extension for truffleruby as well
1 parent 4e048bf commit b8db70d

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

lib/erb/util.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
#
44
# A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
55
# Rails will not monkey-patch ERB::Escape#html_escape.
6-
begin
7-
require 'erb/escape'
8-
rescue LoadError # JRuby can't load .so
9-
end
10-
unless defined?(ERB::Escape) # JRuby
6+
case RUBY_ENGINE
7+
when 'jruby', 'truffleruby'
118
module ERB::Escape
129
def html_escape(s)
1310
CGI.escapeHTML(s.to_s)
1411
end
1512
module_function :html_escape
1613
end
14+
else
15+
require 'erb/escape'
1716
end
1817

1918
#--

0 commit comments

Comments
 (0)