Skip to content

Commit

Permalink
Merge pull request #869 from mame/use-cgi-util
Browse files Browse the repository at this point in the history
Prefer `require 'cgi/util'` instead of `require 'cgi'`
  • Loading branch information
hsbt committed Feb 22, 2022
2 parents a93e1bc + d096222 commit 8310a08
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 0 additions & 2 deletions lib/rdoc/context.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/rdoc/context/section.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# frozen_string_literal: true
require 'cgi/util'

##
# A section of documentation like:
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/markup/to_html.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
require 'cgi'
require 'cgi/util'

##
# Outputs RDoc markup as HTML.
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/markup/to_label.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/method_attr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def block_params=(value)
# HTML id-friendly method/attribute name

def html_name
require 'cgi'
require 'cgi/util'

CGI.escape(@name.gsub('-', '-2D')).gsub('%','-').sub(/^-/, '')
end
Expand Down

0 comments on commit 8310a08

Please sign in to comment.