Skip to content

Commit 9152ce8

Browse files
committed
[DOC] Make documentation 100%
1 parent 420c4bb commit 9152ce8

File tree

6 files changed

+22
-10
lines changed

6 files changed

+22
-10
lines changed

.document

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
LICENSE.txt
2+
NEWS.md
3+
README.md
4+
ext/
5+
lib/
6+
_doc/

.rdoc_options

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
main_page: README.md

_doc/cgi.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# See {CGI document}[https://docs.ruby-lang.org/en/master/CGI.html]
2+
module CGI
3+
end

ext/erb/escape/escape.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@ optimized_escape_html(VALUE str)
6565
return escaped;
6666
}
6767

68-
// ERB::Util.html_escape is different from CGI.escapeHTML in the following two parts:
69-
// * ERB::Util.html_escape converts an argument with #to_s first (only if it's not T_STRING)
70-
// * ERB::Util.html_escape does not allocate a new string when nothing needs to be escaped
68+
/*
69+
* ERB::Util.html_escape is similar to CGI.escapeHTML but different in the following two parts:
70+
*
71+
* * ERB::Util.html_escape converts an argument with #to_s first (only if it's not T_STRING)
72+
* * ERB::Util.html_escape does not allocate a new string when nothing needs to be escaped
73+
*/
7174
static VALUE
7275
erb_escape_html(VALUE self, VALUE str)
7376
{

lib/erb/def_method.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
2-
#--
2+
33
# ERB::DefMethod
44
#
55
# Utility module to define eRuby script as instance method.

lib/erb/util.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# frozen_string_literal: true
2-
#--
3-
# ERB::Escape
4-
#
5-
# A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
6-
# Rails will not monkey-patch ERB::Escape#html_escape.
2+
73
begin
84
# We don't build the C extension for JRuby, TruffleRuby, and WASM
95
if $LOAD_PATH.resolve_feature_path('erb/escape')
@@ -12,6 +8,10 @@
128
rescue LoadError # resolve_feature_path raises LoadError on TruffleRuby 22.3.0
139
end
1410
unless defined?(ERB::Escape)
11+
# ERB::Escape
12+
#
13+
# A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
14+
# Rails will not monkey-patch ERB::Escape#html_escape.
1515
module ERB::Escape
1616
def html_escape(s)
1717
CGI.escapeHTML(s.to_s)
@@ -20,7 +20,6 @@ def html_escape(s)
2020
end
2121
end
2222

23-
#--
2423
# ERB::Util
2524
#
2625
# A utility module for conversion routines, often handy in HTML generation.

0 commit comments

Comments
 (0)