Skip to content

Commit e62210b

Browse files
committed
Keep ERB::Util#html_escape private
ERB::Util.html_escape has been public, but ERB::Util#html_escape had been private.
1 parent 5c10f56 commit e62210b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ext/erb/escape/escape.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Init_escape(void)
8888
{
8989
rb_cERB = rb_define_class("ERB", rb_cObject);
9090
rb_mUtil = rb_define_module_under(rb_cERB, "Util");
91-
rb_define_method(rb_mUtil, "html_escape", erb_escape_html, 1);
91+
rb_define_module_function(rb_mUtil, "html_escape", erb_escape_html, 1);
9292

9393
rb_cCGI = rb_define_class("CGI", rb_cObject);
9494
id_escapeHTML = rb_intern("escapeHTML");

lib/erb/util.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ module ERB::Util
2121
#
2222
# is a > 0 & a < 10?
2323
#
24-
unless method_defined?(:html_escape) # for JRuby
24+
unless defined?(ERB::Util.html_escape) # for JRuby
2525
def html_escape(s)
2626
CGI.escapeHTML(s.to_s)
2727
end
28+
module_function :html_escape
2829
end
2930
alias h html_escape
3031
module_function :h
31-
module_function :html_escape
3232

3333
#
3434
# A utility method for encoding the String _s_ as a URL.

0 commit comments

Comments
 (0)