Fix RuboCop offense Style/RedundantRegexpArgument (#36919).

git-svn-id: https://svn.redmine.org/redmine/trunk@22262 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2023-06-29 00:39:58 +00:00
parent a06f749835
commit e0e751f5bc
4 changed files with 8 additions and 8 deletions

View File

@@ -364,7 +364,7 @@ module Redmine
end
def normalize_cvs_path(path)
normalize_path(path.gsub(/Attic\//,''))
normalize_path(path.gsub("Attic/",''))
end
def normalize_path(path)

View File

@@ -24,9 +24,9 @@ module Redmine
def shell_quote(str)
if Redmine::Platform.mswin?
'"' + str.gsub(/"/, '\\"') + '"'
'"' + str.gsub('"', '\\"') + '"'
else
"'" + str.gsub(/'/, "'\"'\"'") + "'"
"'" + str.gsub("'", "'\"'\"'") + "'"
end
end

View File

@@ -115,7 +115,7 @@ module Redmine
# original language for extension development
langattr = " data-language=\"#{CGI.escapeHTML language}\"" if language.present?
if Redmine::SyntaxHighlighting.language_supported?(language)
text.gsub!(/x%x%/, '&')
text.gsub!("x%x%", '&')
content = "<code class=\"#{CGI.escapeHTML language} syntaxhl\"#{langattr}>" +
Redmine::SyntaxHighlighting.highlight_by_language(text, language)
else

View File

@@ -313,7 +313,7 @@ class RedCloth3 < String
retrieve text
text.gsub!( /<\/?notextile>/, '' )
text.gsub!( /x%x%/, '&#38;' )
text.gsub!( "x%x%", '&#38;' )
clean_html text if filter_html
text.strip!
text
@@ -1016,9 +1016,9 @@ class RedCloth3 < String
def clean_white_space( text )
# normalize line breaks
text.gsub!( /\r\n/, "\n" )
text.gsub!( "\r\n", "\n" )
text.tr!( "\r", "\n" )
text.gsub!( /\t/, ' ' )
text.gsub!( "\t", ' ' )
text.gsub!( /^ +$/, '' )
text.gsub!( /\n{3,}/, "\n\n" )
text.gsub!( /"$/, "\" " )
@@ -1184,7 +1184,7 @@ class RedCloth3 < String
}
def clean_html( text, tags = BASIC_TAGS )
text.gsub!( /<!\[CDATA\[/, '' )
text.gsub!( "<![CDATA[", '' )
text.gsub!( /<(\/*)(\w+)([^>]*)>/ ) do
raw = $~
tag = raw[2].downcase