Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions lib/erb/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
# TruffleRuby: lib/truffle/cgi/escape.rb requires 'cgi/util'.
require 'cgi/escape'

begin
# We don't build the C extension for JRuby, TruffleRuby, and WASM
if $LOAD_PATH.resolve_feature_path('erb/escape')
require 'erb/escape'
end
rescue LoadError # resolve_feature_path raises LoadError on TruffleRuby 22.3.0
end
unless defined?(ERB::Escape)
# Load or define ERB::Escape#html_escape.
# We don't build the C extention 'cgi/escape' for JRuby, TruffleRuby, and WASM.
if $LOAD_PATH.resolve_feature_path('erb/escape')
require 'erb/escape'
else
# ERB::Escape
#
# A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
Expand Down