We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e048bf commit b8db70dCopy full SHA for b8db70d
1 file changed
lib/erb/util.rb
@@ -3,17 +3,16 @@
3
#
4
# A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
5
# 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
+case RUBY_ENGINE
+when 'jruby', 'truffleruby'
11
module ERB::Escape
12
def html_escape(s)
13
CGI.escapeHTML(s.to_s)
14
end
15
module_function :html_escape
16
+else
+ require 'erb/escape'
17
18
19
#--
0 commit comments