summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/erb.rb20
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/erb.rb b/lib/erb.rb
index c588ae1a65..48dcca71aa 100644
--- a/lib/erb.rb
+++ b/lib/erb.rb
@@ -998,20 +998,14 @@ class ERB
#
# is a > 0 & a < 10?
#
- def html_escape(s)
- CGI.escapeHTML(s.to_s)
+ begin
+ # ERB::Util.html_escape
+ require 'erb.so'
+ rescue LoadError
+ def html_escape(s)
+ CGI.escapeHTML(s.to_s)
+ end
end
- end
-
- begin
- require 'erb.so'
- rescue LoadError
- else
- private_constant :Escape
- Util.prepend(Escape)
- end
-
- module Util
alias h html_escape
module_function :h
module_function :html_escape