[ruby/erb] Reapply "Refactor the logic of require 'erb/escape'
(https://github.com/ruby/erb/pull/61)" This reverts commit https://github.com/ruby/erb/commit/1c9200aab071. Now that we've bumped BASERUBY, we shouldn't need to rescue the LoadError. https://github.com/ruby/erb/commit/846b20fe0e
This commit is contained in:
parent
2279da2c91
commit
e8e7daa71a
@ -8,14 +8,11 @@
|
|||||||
# TruffleRuby: lib/truffle/cgi/escape.rb requires 'cgi/util'.
|
# TruffleRuby: lib/truffle/cgi/escape.rb requires 'cgi/util'.
|
||||||
require 'cgi/escape'
|
require 'cgi/escape'
|
||||||
|
|
||||||
begin
|
# Load or define ERB::Escape#html_escape.
|
||||||
# We don't build the C extension for JRuby, TruffleRuby, and WASM
|
# We don't build the C extention 'cgi/escape' for JRuby, TruffleRuby, and WASM.
|
||||||
if $LOAD_PATH.resolve_feature_path('erb/escape')
|
if $LOAD_PATH.resolve_feature_path('erb/escape')
|
||||||
require 'erb/escape'
|
require 'erb/escape'
|
||||||
end
|
else
|
||||||
rescue LoadError # Ruby 3.1+ doesn't raise LoadError on resolve_feature_path, but we may use Ruby 3.0 for BASERUBY here.
|
|
||||||
end
|
|
||||||
unless defined?(ERB::Escape)
|
|
||||||
# ERB::Escape
|
# ERB::Escape
|
||||||
#
|
#
|
||||||
# A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
|
# A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
|
||||||
|
Loading…
x
Reference in New Issue
Block a user