diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-26 22:30:43 -0800 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-11-27 06:30:48 +0000 |
commit | d2c62426e5f5a53fd17e07e789a92994be4351ed (patch) | |
tree | aecdb86c59200431236f614855cb2daf214ad52a /lib/erb | |
parent | ec76c9868b9b707aa657b59b8bb9e737c7ff91e7 (diff) |
[ruby/erb] Skip using the extension for truffleruby as well
(https://github.com/ruby/erb/pull/39)
* Skip using the extension for truffleruby as well
* Just skip building the C extension for TruffleRuby
* Skip rake compile for truffleruby
* Use resolve_feature_path
* Revert "Use resolve_feature_path"
This reverts commit https://github.com/ruby/erb/commit/acc1e0c0ffaf.
* Use resolve_feature_path with LoadError guard
https://github.com/ruby/erb/commit/85dcb08439
Diffstat (limited to 'lib/erb')
-rw-r--r-- | lib/erb/util.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/erb/util.rb b/lib/erb/util.rb index c24a175199..0c1e7482a8 100644 --- a/lib/erb/util.rb +++ b/lib/erb/util.rb @@ -4,10 +4,13 @@ # A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope # Rails will not monkey-patch ERB::Escape#html_escape. begin - require 'erb/escape' -rescue LoadError # JRuby can't load .so + # 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) # JRuby +unless defined?(ERB::Escape) module ERB::Escape def html_escape(s) CGI.escapeHTML(s.to_s) |