summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2023-05-29 13:53:49 +0200
committergit <svn-admin@ruby-lang.org>2023-05-29 19:33:38 +0000
commitf61bd3ca806dab1de8052f70bb72938b8ef64edc (patch)
treefdfef12cd6bbb6fd15bbf2c52cd574ed36bd3eb1 /lib
parent610038f3bf6eae50c0ad4f16af02d4c50a812e2a (diff)
[ruby/cgi] Add TruffleRuby support and add it in CI
https://github.com/ruby/cgi/commit/1240fec9c9
Diffstat (limited to 'lib')
-rw-r--r--lib/cgi/util.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb
index 5a5c77ac97..5f335898dc 100644
--- a/lib/cgi/util.rb
+++ b/lib/cgi/util.rb
@@ -90,9 +90,12 @@ module CGI::Util
end
end
- begin
- require 'cgi/escape'
- rescue LoadError
+ # TruffleRuby runs the pure-Ruby variant faster, do not use the C extension there
+ unless RUBY_ENGINE == 'truffleruby'
+ begin
+ require 'cgi/escape'
+ rescue LoadError
+ end
end
# Unescape a string that has been HTML-escaped