diff options
author | Go MAEDA <maeda@farend.jp> | 2024-09-01 00:38:01 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-09-01 00:38:01 +0000 |
commit | 2fe36c41281252c5fb63ead8ec239c737a88468b (patch) | |
tree | 6ff46d0c1d4291d2d75fdd721694eb263747f398 /lib | |
parent | 8da72cb712dce17d6537cf71ab90b6d1959e37a1 (diff) | |
download | redmine-2fe36c41281252c5fb63ead8ec239c737a88468b.tar.gz redmine-2fe36c41281252c5fb63ead8ec239c737a88468b.zip |
Fix RuboCop offense Style/RedundantInterpolationUnfreeze (#39887).
Since interpolated strings are always unfrozen in Ruby 3.0 and later, the use of `+""` is now redundant.
git-svn-id: https://svn.redmine.org/redmine/trunk@23001 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/scm/adapters/subversion_adapter.rb | 14 | ||||
-rw-r--r-- | lib/redmine/wiki_formatting/textile/redcloth3.rb | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/lib/redmine/scm/adapters/subversion_adapter.rb b/lib/redmine/scm/adapters/subversion_adapter.rb index f0e6722f0..c4bb31148 100644 --- a/lib/redmine/scm/adapters/subversion_adapter.rb +++ b/lib/redmine/scm/adapters/subversion_adapter.rb @@ -60,7 +60,7 @@ module Redmine # Get info about the svn repository def info - cmd = +"#{self.class.sq_bin} info --xml #{target}" + cmd = "#{self.class.sq_bin} info --xml #{target}" cmd << credentials_string info = nil shellout(cmd) do |io| @@ -98,7 +98,7 @@ module Redmine path ||= '' identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" entries = Entries.new - cmd = +"#{self.class.sq_bin} list --xml #{target(path)}@#{identifier}" + cmd = "#{self.class.sq_bin} list --xml #{target(path)}@#{identifier}" cmd << credentials_string shellout(cmd) do |io| output = io.read.force_encoding('UTF-8') @@ -146,7 +146,7 @@ module Redmine return nil unless self.class.client_version_above?([1, 5, 0]) identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" - cmd = +"#{self.class.sq_bin} proplist --verbose --xml #{target(path)}@#{identifier}" + cmd = "#{self.class.sq_bin} proplist --verbose --xml #{target(path)}@#{identifier}" cmd << credentials_string properties = {} shellout(cmd) do |io| @@ -169,7 +169,7 @@ module Redmine identifier_from = (identifier_from && identifier_from.to_i > 0) ? identifier_from.to_i : "HEAD" identifier_to = (identifier_to && identifier_to.to_i > 0) ? identifier_to.to_i : 1 revisions = Revisions.new - cmd = +"#{self.class.sq_bin} log --xml -r #{identifier_from}:#{identifier_to}" + cmd = "#{self.class.sq_bin} log --xml -r #{identifier_from}:#{identifier_to}" cmd << credentials_string cmd << " --verbose " if options[:with_paths] cmd << " --limit #{options[:limit].to_i}" if options[:limit] @@ -218,7 +218,7 @@ module Redmine identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : (identifier_from.to_i - 1) - cmd = +"#{self.class.sq_bin} diff -r " + cmd = "#{self.class.sq_bin} diff -r " cmd << "#{identifier_to}:" cmd << "#{identifier_from}" cmd << " #{target(path)}@#{identifier_from}" @@ -236,7 +236,7 @@ module Redmine def cat(path, identifier=nil) identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" - cmd = +"#{self.class.sq_bin} cat #{target(path)}@#{identifier}" + cmd = "#{self.class.sq_bin} cat #{target(path)}@#{identifier}" cmd << credentials_string cat = nil shellout(cmd) do |io| @@ -250,7 +250,7 @@ module Redmine def annotate(path, identifier=nil) identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD" - cmd = +"#{self.class.sq_bin} blame #{target(path)}@#{identifier}" + cmd = "#{self.class.sq_bin} blame #{target(path)}@#{identifier}" cmd << credentials_string blame = Annotate.new shellout(cmd) do |io| diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb index f6e738786..71261334c 100644 --- a/lib/redmine/wiki_formatting/textile/redcloth3.rb +++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb @@ -580,9 +580,9 @@ class RedCloth3 < String depth << tl atts = pba(atts) atts = shelve(atts) if atts - lines[line_id] = +"\t<#{lT(tl)}l#{atts}>\n\t<li>#{content}" + lines[line_id] = "\t<#{lT(tl)}l#{atts}>\n\t<li>#{content}" else - lines[line_id] = +"\t\t<li>#{content}" + lines[line_id] = "\t\t<li>#{content}" end last_line = line_id else @@ -632,7 +632,7 @@ class RedCloth3 < String text.gsub!(CODE_RE) do |m| before, lang, code, after = $~[1..4] lang = " lang=\"#{lang}\"" if lang - rip_offtags(+"#{before}<code#{lang}>#{code}</code>#{after}", false) + rip_offtags("#{before}<code#{lang}>#{code}</code>#{after}", false) end end @@ -844,7 +844,7 @@ class RedCloth3 < String next all unless uri_with_link_safe_scheme?(url) atts = pba(atts) - atts = +" href=\"#{url}#{slash}\"#{atts}" + atts = " href=\"#{url}#{slash}\"#{atts}" atts << " title=\"#{htmlesc title}\"" if title atts = shelve(atts) if atts external = (url =~ /^https?:\/\//) ? ' class="external"' : '' @@ -953,7 +953,7 @@ class RedCloth3 < String stln, algn, atts, url, title, href, href_a1, href_a2 = $~[1..8] htmlesc title atts = pba(atts) - atts = +" src=\"#{htmlesc url.dup}\"#{atts}" + atts = " src=\"#{htmlesc url.dup}\"#{atts}" atts << " title=\"#{title}\"" if title atts << " alt=\"#{title}\"" # size = @getimagesize($url); @@ -1099,12 +1099,12 @@ class RedCloth3 < String ### NB: some changes were made not to use $N variables, because we use "match" ### and it breaks following lines htmlesc(aftertag, :NoQuotes) if aftertag && escape_aftertag && !first.match(/<code\s+class="(\w+)">/) - line = +"<redpre##{@pre_list.length}>" + line = "<redpre##{@pre_list.length}>" first =~ /<#{OFFTAGS}([^>]*)>/o tag = $1 $2.to_s =~ /(class\=("[^"]+"|'[^']+'))/i tag << " #{$1}" if $1 && tag == 'code' - @pre_list << +"<#{tag}>#{aftertag}" + @pre_list << "<#{tag}>#{aftertag}" end elsif $1 and codepre > 0 if codepre - used_offtags.length > 0 |