Skip to content

Commit 1c9200a

Browse files
committed
Revert "Refactor the logic of require 'erb/escape' (#61)"
This reverts commit 1c393aa.
1 parent 08b544c commit 1c9200a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/erb/util.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
# TruffleRuby: lib/truffle/cgi/escape.rb requires 'cgi/util'.
99
require 'cgi/escape'
1010

11-
# Load or define ERB::Escape#html_escape.
12-
# We don't build the C extention 'cgi/escape' for JRuby, TruffleRuby, and WASM.
13-
if $LOAD_PATH.resolve_feature_path('erb/escape')
14-
require 'erb/escape'
15-
else
11+
begin
12+
# We don't build the C extension for JRuby, TruffleRuby, and WASM
13+
if $LOAD_PATH.resolve_feature_path('erb/escape')
14+
require 'erb/escape'
15+
end
16+
rescue LoadError # resolve_feature_path raises LoadError on TruffleRuby 22.3.0
17+
end
18+
unless defined?(ERB::Escape)
1619
# ERB::Escape
1720
#
1821
# A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope

0 commit comments

Comments
 (0)