Bug #541

cgi.rb : obsolete regex "n" option

Added by Takeyuki FUJIOKA over 6 years ago. Updated about 4 years ago.

[ruby-dev:36130]
Status:Closed
Priority:Normal
Assignee:Takeyuki FUJIOKA
ruby -v: Backport:

Description

=begin
CGI::prettyの正規表現部分にnが使われているので
warningが出ます。
Index: lib/cgi.rb
===================================================================
--- lib/cgi.rb (リビジョン 19071)
+++ lib/cgi.rb (作業コピー)
@@ -1245,14 +1245,14 @@
# #
#
def CGI::pretty(string, shift = " ")
- lines = string.gsub(/(?!\A)<(?:.|\n)?>/n, "\n\0").gsub(/<(?:.|\n)?>(?!\n)/n, "\0\n")
+ lines = string.gsub(/(?!\A)<(?:.|\n)?>/, "\n\0").gsub(/<(?:.|\n)?>(?!\n)/, "\0\n")
end_pos = 0
- while end_pos = lines.index(/<\/(\w+)/n, end_pos)
+ while end_pos = lines.index(/<\/(\w+)/, end_pos)
element = $1.dup
- start_pos = lines.rindex(/\s*<#{element}/ni, end_pos)
- lines[start_pos ... end_pos] = "" + lines[start_pos ... end_pos].gsub(/\n(?!\z)/n, "\n" + shift) + ""
+ start_pos = lines.rindex(/\s*<#{element}/i, end_pos)
+ lines[start_pos ... end_pos] = "" + lines[start_pos ... end_pos].gsub(/\n(?!\z)/, "\n" + shift) + ""
end
- lines.gsub(/(?:#{Regexp::quote(shift}))__(?=<\/?\w)/n, '\1')
+ lines.gsub(/(?:#{Regexp::quote(shift})
)__(?=<\/?\w)/, '\1')
end
=end

History

#1 Updated by Koichi Sasada over 6 years ago

  • Assignee set to Takeyuki FUJIOKA

=begin

=end

#2 Updated by Takeyuki FUJIOKA over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r19245.
=end

Also available in: Atom PDF