]> source.dussan.org Git - redmine.git/commitdiff
Fix RuboCop offense Style/RedundantRegexpArgument (#36919).
authorGo MAEDA <maeda@farend.jp>
Thu, 29 Jun 2023 00:39:58 +0000 (00:39 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 29 Jun 2023 00:39:58 +0000 (00:39 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@22262 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/cvs_adapter.rb
lib/redmine/utils/shell.rb
lib/redmine/wiki_formatting/textile/formatter.rb
lib/redmine/wiki_formatting/textile/redcloth3.rb

index 9fdc2a307189090ba8935d14af890cb137789e2d..4d694a6abdfe7dad8796046ab6b5ced0a4eb6f55 100644 (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)
index 1de5283d1ab390dd7c014b67e9e4d919bebc12bc..f3b769f578e439304d39a54826513f91bdf87e84 100644 (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
 
index 53c04341d82d9ec247970c368c0b4e7ea0105b51..f29b3960ed34a3cae9f4ccde7f3cceb702738ab0 100644 (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
index 406fca08dd25971e3e3de83db41e410b4c8c6cc5..d77a0664bbab9124dccee3425a9ad435ba6f3eda 100644 (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