mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/rdoc] Prefer require 'cgi/util'
instead of require 'cgi'
RDoc is using only CGI.escape, escapeHTML, and unescape. We don't have to load the whole source code of cgi gem. https://github.com/ruby/rdoc/commit/d096222cc2
This commit is contained in:
parent
a49aae2c5e
commit
ae8a8b184e
5 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require 'cgi'
|
||||
|
||||
##
|
||||
# A Context is something that can hold modules, classes, methods, attributes,
|
||||
# aliases, requires, and includes. Classes, modules, and files are all
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
require 'cgi/util'
|
||||
|
||||
##
|
||||
# A section of documentation like:
|
||||
#
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require 'cgi'
|
||||
require 'cgi/util'
|
||||
|
||||
##
|
||||
# Outputs RDoc markup as HTML.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require 'cgi'
|
||||
require 'cgi/util'
|
||||
|
||||
##
|
||||
# Creates HTML-safe labels suitable for use in id attributes. Tidylinks are
|
||||
|
|
|
@ -289,7 +289,7 @@ class RDoc::MethodAttr < RDoc::CodeObject
|
|||
# HTML id-friendly method/attribute name
|
||||
|
||||
def html_name
|
||||
require 'cgi'
|
||||
require 'cgi/util'
|
||||
|
||||
CGI.escape(@name.gsub('-', '-2D')).gsub('%','-').sub(/^-/, '')
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue