]> source.dussan.org Git - redmine.git/commitdiff
Support frozen_string_literal in lib/**/*.rb (#26561).
authorGo MAEDA <maeda@farend.jp>
Sun, 17 Mar 2019 16:36:34 +0000 (16:36 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 17 Mar 2019 16:36:34 +0000 (16:36 +0000)
Contributed by Pavel Rosický.

git-svn-id: http://svn.redmine.org/redmine/trunk@17988 e93f8b46-1217-0410-a6f0-8f06a7374b81

40 files changed:
lib/plugins/acts_as_activity_provider/init.rb
lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb
lib/plugins/acts_as_attachable/init.rb
lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
lib/plugins/acts_as_customizable/init.rb
lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb
lib/plugins/acts_as_event/init.rb
lib/plugins/acts_as_event/lib/acts_as_event.rb
lib/plugins/acts_as_searchable/init.rb
lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb
lib/plugins/acts_as_tree/Rakefile
lib/plugins/acts_as_tree/lib/active_record/acts/tree.rb
lib/plugins/acts_as_tree/test/acts_as_tree_test.rb
lib/plugins/acts_as_watchable/init.rb
lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
lib/plugins/gravatar/init.rb
lib/plugins/open_id_authentication/lib/open_id_authentication.rb
lib/redmine/field_format.rb
lib/redmine/helpers/diff.rb
lib/redmine/helpers/gantt.rb
lib/redmine/info.rb
lib/redmine/pagination.rb
lib/redmine/scm/adapters/abstract_adapter.rb
lib/redmine/scm/adapters/bazaar_adapter.rb
lib/redmine/scm/adapters/cvs_adapter.rb
lib/redmine/scm/adapters/filesystem_adapter.rb
lib/redmine/scm/adapters/git_adapter.rb
lib/redmine/scm/adapters/mercurial_adapter.rb
lib/redmine/scm/adapters/subversion_adapter.rb
lib/redmine/unified_diff.rb
lib/redmine/wiki_formatting.rb
lib/redmine/wiki_formatting/html_parser.rb
lib/redmine/wiki_formatting/macros.rb
lib/redmine/wiki_formatting/markdown/formatter.rb
lib/redmine/wiki_formatting/markdown/helper.rb
lib/redmine/wiki_formatting/markdown/html_parser.rb
lib/redmine/wiki_formatting/textile/formatter.rb
lib/redmine/wiki_formatting/textile/helper.rb
lib/redmine/wiki_formatting/textile/html_parser.rb
lib/redmine/wiki_formatting/textile/redcloth3.rb

index 781bd3f47fa8dfe35d48224c37782a4c4b9c26a3..465ab3b9b912e33590625a9da4860783d52742f2 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 require File.dirname(__FILE__) + '/lib/acts_as_activity_provider'
 ActiveRecord::Base.send(:include, Redmine::Acts::ActivityProvider)
index 325176ddf98f18cba31d9a7b09ea71c5536cbb1f..e92f68146f6f7947970fe317cc9ab64fb3523f6a 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 66ecc7849f632a73612ccb973655d41d60e30f5f..fad72214c07e3b5c497bdcdfdb1d6af935d47776 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 require File.dirname(__FILE__) + '/lib/acts_as_attachable'
 ActiveRecord::Base.send(:include, Redmine::Acts::Attachable)
index b895a9f55b834d4a8782f208781b92868e9fdd14..4a2ce905553a4348c0db10562b588a3d80ef9b6c 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 2139e96c64fe1550acef1345ef6b0f39994a2af5..c44db3df0c490ae676a264ba81d6bb50986fb669 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 require File.dirname(__FILE__) + '/lib/acts_as_customizable'
 ActiveRecord::Base.send(:include, Redmine::Acts::Customizable)
index 5413a456f6780291530e7d6eaddb940f37d2b02d..a5568f635189297d0b311a568566ef0f0e0b9129 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 2a78cd2d3d80f0b9129f0f0664c00a5b1a94e9b2..2c025f2c01312cf92fb528977ae1756ff5d40f6d 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 require File.dirname(__FILE__) + '/lib/acts_as_event'
 ActiveRecord::Base.send(:include, Redmine::Acts::Event)
index f77c12d702f0aad324e6d51ded9d1d87bd6f2c36..2ff1eea12bbb84a9a42c2965b1d56460add021a2 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 204d0ce36c3bd97ca0d4417dc6aa9c939ba82f6a..661b0203da24160289c88d26c70772e4bbbf93ea 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 require File.dirname(__FILE__) + '/lib/acts_as_searchable'
 ActiveRecord::Base.send(:include, Redmine::Acts::Searchable)
index 79a3f88fbe90dfabcd1f80338775eea3c8b3a816..61c1704fef803df31cb4e2ee78b4cb9d8b2f8dec 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 255df7de4003f491cb47e08d42605238fd77d21f..bf194199ae676a329354addc5a0f1fdf6cebc18c 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 require 'rake'
 require 'rake/testtask'
index 668c600c4bbaae1d85ec58fa1dae67114ee481a8..14dce355a8656f5ff33a7b4388f0e8b20f172781 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 module ActiveRecord
   module Acts
index 81a0033c5bf126adc6735efb61070bf880e3ec2b..9ee4b8a42289adc5e41fd43f08297b3218f6b8f8 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 require 'test/unit'
 
index 4a9a14237a27a9f94825bafad73dcf7741404e24..d91feec418e0768f4ad11ad74bea170f97761f7a 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Include hook code here
 require File.dirname(__FILE__) + '/lib/acts_as_watchable'
index 8890326d1722f3aecf24acfc7ac094c3cf805ff7..1ebe9e2fc34903a543acb9133a622133ea763d79 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # ActsAsWatchable
 module Redmine
index 65c9fce003f3f2bd0d68deaaad1ef53f17dd1532..5bf49923d70e94b58245e0c1abdf4c47ce9d5a81 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 require 'gravatar'
 ActionView::Base.send :include, GravatarHelper::PublicMethods
index 7754afece346425186865e831f444b96dbbdd880..711a38d43300cc2743e48c24b75e3d1572bb64ec 100644 (file)
@@ -89,7 +89,7 @@ module OpenIdAuthentication
     # dodge XRIs -- TODO: validate, don't just skip.
     unless ['=', '@', '+', '$', '!', '('].include?(identifier.at(0))
       # does it begin with http?  if not, add it.
-      identifier = "http://#{identifier}" unless identifier =~ /^http/i
+      identifier = +"http://#{identifier}" unless identifier =~ /^http/i
 
       # strip any fragments
       identifier.gsub!(/\#(.*)$/, '')
index 29be3c9fd63c41631ed7da053fb01747a22dcbba..e1aba49f5e8f2c5bb3c54a10f946aa33b15402dd 100644 (file)
@@ -185,7 +185,7 @@ module Redmine
 
       def parse_keyword(custom_field, keyword, &block)
         separator = Regexp.escape ","
-        keyword = keyword.to_s
+        keyword = keyword.dup.to_s
 
         if custom_field.multiple?
           values = []
index 6f61e3e5240e59f3847b9f18e6da4861092f39f7..1217121ad1bc42b194c4ab1034898fc43180a2dc 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
@@ -46,7 +46,7 @@ module Redmine
           add_at = nil
           add_to = nil
           del_at = nil
-          deleted = ""
+          deleted = +""
           diff.each do |change|
             pos = change[1]
             if change[0] == "+"
index abe783267b5a3375b9e46f3da16f358bc760ca07..ac2b34e3d0908695ab2c9fca0fcdd6266f411a10 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
@@ -76,8 +76,8 @@ module Redmine
         end
         @date_from = Date.civil(@year_from, @month_from, 1)
         @date_to = (@date_from >> @months) - 1
-        @subjects = ''
-        @lines = ''
+        @subjects = +''
+        @lines = +''
         @number_of_rows = nil
         @truncated = false
         if options.has_key?(:max_rows)
@@ -198,8 +198,8 @@ module Redmine
                    :indent_increment => 20, :render => :subject,
                    :format => :html}.merge(options)
         indent = options[:indent] || 4
-        @subjects = '' unless options[:only] == :lines
-        @lines = '' unless options[:only] == :subjects
+        @subjects = +'' unless options[:only] == :lines
+        @lines = +'' unless options[:only] == :subjects
         @number_of_rows = 0
         begin
           Project.project_tree(projects) do |project, level|
@@ -652,7 +652,7 @@ module Redmine
         case object
         when Issue
           issue = object
-          css_classes = ''
+          css_classes = +''
           css_classes << ' issue-overdue' if issue.overdue?
           css_classes << ' issue-behind-schedule' if issue.behind_schedule?
           css_classes << ' icon icon-issue' unless Setting.gravatar_enabled? && issue.assigned_to
@@ -663,7 +663,7 @@ module Redmine
             css_classes << ' behind-start-date' if progress_date < self.date_from
             css_classes << ' over-end-date' if progress_date > self.date_to
           end
-          s = "".html_safe
+          s = (+"").html_safe
           if issue.assigned_to.present?
             assigned_string = l(:field_assigned_to) + ": " + issue.assigned_to.name
             s << view.avatar(issue.assigned_to,
@@ -676,7 +676,7 @@ module Redmine
           view.content_tag(:span, s, :class => css_classes).html_safe
         when Version
           version = object
-          html_class = ""
+          html_class = +""
           html_class << 'icon icon-package '
           html_class << (version.behind_schedule? ? 'version-behind-schedule' : '') << " "
           html_class << (version.overdue? ? 'version-overdue' : '')
@@ -691,7 +691,7 @@ module Redmine
           view.content_tag(:span, s, :class => html_class).html_safe
         when Project
           project = object
-          html_class = ""
+          html_class = +""
           html_class << 'icon icon-projects '
           html_class << (project.overdue? ? 'project-overdue' : '')
           s = view.link_to_project(project).html_safe
@@ -727,7 +727,7 @@ module Redmine
         end
         if has_children
           content = view.content_tag(:span, nil, :class => :expander) + content
-          tag_options[:class] << ' open'
+          tag_options[:class] += ' open'
         else
           if params[:indent]
             params = params.dup
@@ -735,7 +735,7 @@ module Redmine
           end
         end
         style = "position: absolute;top:#{params[:top]}px;left:#{params[:indent]}px;"
-        style << "width:#{params[:subject_width] - params[:indent]}px;" if params[:subject_width]
+        style += "width:#{params[:subject_width] - params[:indent]}px;" if params[:subject_width]
         tag_options[:style] = style
         output = view.content_tag(:div, content, tag_options)
         @subjects << output
@@ -774,7 +774,7 @@ module Redmine
       end
 
       def html_task(params, coords, markers, label, object)
-        output = ''
+        output = +''
         data_options = {}
         data_options[:collapse_expand] = "#{object.class}-#{object.id}".downcase if object
 
@@ -792,7 +792,7 @@ module Redmine
         # Renders the task bar, with progress and late
         if coords[:bar_start] && coords[:bar_end]
           width = coords[:bar_end] - coords[:bar_start] - 2
-          style = ""
+          style = +""
           style << "top:#{params[:top]}px;"
           style << "left:#{coords[:bar_start]}px;"
           style << "width:#{width}px;"
@@ -812,7 +812,7 @@ module Redmine
           output << view.content_tag(:div, '&nbsp;'.html_safe, content_opt)
           if coords[:bar_late_end]
             width = coords[:bar_late_end] - coords[:bar_start] - 2
-            style = ""
+            style = +""
             style << "top:#{params[:top]}px;"
             style << "left:#{coords[:bar_start]}px;"
             style << "width:#{width}px;"
@@ -823,7 +823,7 @@ module Redmine
           end
           if coords[:bar_progress_end]
             width = coords[:bar_progress_end] - coords[:bar_start] - 2
-            style = ""
+            style = +""
             style << "top:#{params[:top]}px;"
             style << "left:#{coords[:bar_start]}px;"
             style << "width:#{width}px;"
@@ -839,7 +839,7 @@ module Redmine
         # Renders the markers
         if markers
           if coords[:start]
-            style = ""
+            style = +""
             style << "top:#{params[:top]}px;"
             style << "left:#{coords[:start]}px;"
             style << "width:15px;"
@@ -849,7 +849,7 @@ module Redmine
                                        :data => data_options)
           end
           if coords[:end]
-            style = ""
+            style = +""
             style << "top:#{params[:top]}px;"
             style << "left:#{coords[:end] + params[:zoom]}px;"
             style << "width:15px;"
@@ -861,7 +861,7 @@ module Redmine
         end
         # Renders the label on the right
         if label
-          style = ""
+          style = +""
           style << "top:#{params[:top]}px;"
           style << "left:#{(coords[:bar_end] || 0) + 8}px;"
           style << "width:15px;"
@@ -876,7 +876,7 @@ module Redmine
                                view.render_issue_tooltip(object).html_safe,
                                :class => "tip")
           s += view.content_tag(:input, nil, :type => 'checkbox', :name => 'ids[]', :value => object.id, :style => 'display:none;', :class => 'toggle-selection')
-          style = ""
+          style = +""
           style << "position: absolute;"
           style << "top:#{params[:top]}px;"
           style << "left:#{coords[:bar_start]}px;"
index 276c72d40cbbdcdc47891cbe16d5de222feb5570..a51deb2277d54fe32a37175d296943faa0281290 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 module Redmine
   module Info
@@ -9,7 +9,7 @@ module Redmine
       def versioned_name; "#{app_name} #{Redmine::VERSION}" end
 
       def environment
-        s = "Environment:\n"
+        s = +"Environment:\n"
         s << [
           ["Redmine version", Redmine::VERSION],
           ["Ruby version", "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"],
index f549897ac7d27e635c2e262c1c6e3e17d87e3715..b51251b697d810f712e2cb829442627262618082 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
@@ -159,7 +159,7 @@ module Redmine
         per_page_links = false if count.nil?
         page_param = paginator.page_param
 
-        html = '<ul class="pages">'
+        html = +'<ul class="pages">'
 
         if paginator.multiple_pages?
           # \xc2\xab(utf-8) = &#171;
index 7665b0d841803c22f66ba01628f5485874078bfd..55753d27ed89f33578708f6ea4b858afa006f9e5 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
@@ -214,7 +214,7 @@ module Redmine
             path = Redmine::Configuration['scm_stderr_log_file'].presence
             path ||= Rails.root.join("log/#{Rails.env}.scm.stderr.log").to_s
             if File.exists?(path)
-              if File.file?(path) && File.writable?(path) 
+              if File.file?(path) && File.writable?(path)
                 writable = true
               else
                 logger.warn("SCM log file (#{path}) is not writable")
@@ -276,8 +276,9 @@ module Redmine
         end
 
         def scm_iconv(to, from, str)
-          return nil if str.nil?
+          return if str.nil?
           return str if to == from && str.encoding.to_s == from
+          str = str.dup
           str.force_encoding(from)
           begin
             str.encode(to)
index 2c5996b349e4fcc3a3def6ca757e7a0651cbd4b2..af48a9d0f46e4d087c3a8e0391f3f416fbbb5ddb 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
@@ -154,7 +154,7 @@ module Redmine
                   parsing = $1
                 elsif line =~ /^  (.*)$/
                   if parsing == 'message'
-                    revision.message << "#{$1}\n"
+                    revision.message += "#{$1}\n"
                   else
                     if $1 =~ /^(.*)\s+(\S+)$/
                       path_locale = $1.strip
index 730ee5caaa7add7288b5427ce57024ed9618a39a..c45987f33dc7b29914b8ad25c07e36801ec3bd4e 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # redMine - project management software
 # Copyright (C) 2006-2007  Jean-Philippe Lang
@@ -93,7 +93,7 @@ module Redmine
         def entries(path=nil, identifier=nil, options={})
           logger.debug "<cvs> entries '#{path}' with identifier '#{identifier}'"
           path_locale = scm_iconv(@path_encoding, 'UTF-8', path)
-          path_locale.force_encoding("ASCII-8BIT")
+          path_locale = path_locale.dup.force_encoding("ASCII-8BIT")
           entries = Entries.new
           cmd_args = %w|-q rls -e|
           cmd_args << "-D" << time_to_cvstime_rlog(identifier) if identifier
@@ -161,7 +161,7 @@ module Redmine
           cmd_args << path_with_project_utf8
           scm_cmd(*cmd_args) do |io|
             state      = "entry_start"
-            commit_log = String.new
+            commit_log = ""
             revision   = nil
             date       = nil
             author     = nil
@@ -171,7 +171,7 @@ module Redmine
             branch_map = nil
             io.each_line() do |line|
               if state != "revision" && /^#{ENDLOG}/ =~ line
-                commit_log = String.new
+                commit_log = ""
                 revision   = nil
                 state      = "entry_start"
               end
@@ -186,7 +186,7 @@ module Redmine
                 elsif /^symbolic names:/ =~ line
                   state = "symbolic" #unless entry.nil?
                 elsif /^#{STARTLOG}/ =~ line
-                  commit_log = String.new
+                  commit_log = ""
                   state      = "revision"
                 end
                 next
@@ -230,7 +230,7 @@ module Redmine
                            }]
                          })
                   end
-                  commit_log = String.new
+                  commit_log = ""
                   revision   = nil
                   if /^#{ENDLOG}/ =~ line
                     state = "entry_start"
@@ -261,7 +261,7 @@ module Redmine
                   #                  version.line_minus = 0
                   #                end
                 else
-                  commit_log << line unless line =~ /^\*\*\* empty log message \*\*\*/
+                  commit_log += line unless line =~ /^\*\*\* empty log message \*\*\*/
                 end
               end
             end
index 0ff289df4fb613c2a085d7c7a9a44eaa2601b41c..4335244bedea86e1f21ec2380d407ae6848eec1f 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 3a910336043bb7a122a9dedd63319730a0b564fc..1889dcda695eecfbdfcbbb7ffe6c57c071b362ea 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
@@ -203,7 +203,7 @@ module Redmine
           cmd_args << "--" << scm_iconv(@path_encoding, 'UTF-8', path) if path && !path.empty?
           revisions = []
           if identifier_from || identifier_to
-            revisions << ""
+            revisions << +""
             revisions[0] << "#{identifier_from}.." if identifier_from
             revisions[0] << "#{identifier_to}" if identifier_to
           else
@@ -261,7 +261,7 @@ module Redmine
                 end
               elsif (parsing_descr == 0) && line.chomp.to_s == ""
                 parsing_descr = 1
-                changeset[:description] = ""
+                changeset[:description] = +""
               elsif (parsing_descr == 1 || parsing_descr == 2) \
                   && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\t(.+)$/
                 parsing_descr = 2
index 32637b2f1e2ca18461d26c6a9f27912a087681b7..fceebf03522c9bb734a997397317f81a48b48cec 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 79276feb6894ab796953e89d35628aee6980e5e5..ad99217c3183d1a940f4fe5755ecf8dc2d82ddff 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
@@ -61,7 +61,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|
@@ -91,7 +91,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')
@@ -130,7 +130,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|
@@ -152,7 +152,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]
@@ -192,7 +192,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}"
@@ -209,7 +209,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|
@@ -222,7 +222,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|
@@ -244,7 +244,7 @@ module Redmine
         private
 
         def credentials_string
-          str = ''
+          str = +''
           str << " --username #{shell_quote(@login)}" unless @login.blank?
           str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank?
           str << " --no-auth-cache --non-interactive"
index d4c93db0ee80917e84b302661e0a79df51e011d1..7fa818751403fafa96ef625cf6f7630caa0aaf6b 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
@@ -274,7 +274,7 @@ module Redmine
 
     def line_to_html_raw(line, offsets)
       if offsets
-        s = ''
+        s = +''
         unless offsets.first == 0
           s << CGI.escapeHTML(line[0..offsets.first-1])
         end
index 22309b22825bc4710a5a2523a1bcff78348122e3..5152cc75261c32bb5b05d23be5d6e991452fe1dc 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index d1c90b502a7423213a67b948e340393bf2f79fff..62445ff3bc3ff65b8bb91955a00f775b559a314e 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index c1e3ee4e5cd53fdbd90b598123f9ab83bc507637..48c91b6e82f76ea1ff094983818a24619d0a94e0 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index f605e94b740ceb6e9bd5b278e17084ff6a8a4010..20c18bcafba6805451504fde6046c9343b376abb 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
@@ -83,7 +83,7 @@ module Redmine
         end
 
         def extract_sections(index)
-          sections = ['', '', '']
+          sections = [+'', +'', +'']
           offset = 0
           i = 0
           l = 1
index 0a5998cf4a90400c635f75e9594a8ae9963972cd..4f79acdd7e280a7b088ea1c7c94ff6db993b933d 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 7cf0a1d3753ab75bbbf6e08000119b51ec5e8404..d3900a2bda7dcab3db50ae77b7f2f5d3c95fac2f 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 313595c580df3f14dc2d138be2829a77a47b40e3..aec94bc6e05f54eb5924c74b675d1edce81237eb 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
@@ -65,9 +65,9 @@ module Redmine
           @pre_list = []
           text = self.dup
           rip_offtags text, false, false
-          before = ''
-          s = ''
-          after = ''
+          before = +''
+          s = +''
+          after = +''
           i = 0
           l = 1
           started = false
index b29ade8be0a93ce015866907547005247a63cfa9..3d8c2d163335cf591ff259850082d24f03e4471a 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 467281d87a4e996b7d96d0b8220e4e4855703b60..35215a336eb8727de328872812f8e0072959f559 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 # Redmine - project management software
 # Copyright (C) 2006-2017  Jean-Philippe Lang
index 1cd5e0580717aa3072ae30204761b15e0e532777..c4dc4c25efd3473225e164a322da396591a2cced 100644 (file)
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
 
 #                                vim:ts=4:sw=4:
 # = RedCloth - Textile and Markdown Hybrid for Ruby
@@ -467,7 +467,7 @@ class RedCloth3 < String
     # Parses Textile attribute lists and builds an HTML attribute string
     def pba( text_in, element = "" )
         
-        return '' unless text_in
+        return +'' unless text_in
 
         style = []
         text = text_in.dup
@@ -505,7 +505,7 @@ class RedCloth3 < String
 
         id = id.starts_with?('wiki-id-') ? id : "wiki-id-#{id}" if id
 
-        atts = ''
+        atts = +''
         atts << " style=\"#{ style.join }\"" unless style.empty?
         atts << " class=\"#{ cls }\"" unless cls.to_s.empty?
         atts << " lang=\"#{ lang }\"" if lang
@@ -586,9 +586,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
 
@@ -611,7 +611,7 @@ class RedCloth3 < String
     def block_textile_quotes( text )
       text.gsub!( QUOTES_RE ) do |match|
         lines = match.split( /\n/ )
-        quotes = ''
+        quotes = +''
         indent = 0
         lines.each do |line|
           line =~ QUOTES_CONTENT_RE 
@@ -639,7 +639,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
 
@@ -851,7 +851,7 @@ class RedCloth3 < String
               post = ")"+post # add closing parenth to post
             end
             atts = pba( atts )
-            atts = " href=\"#{ htmlesc url }#{ slash }\"#{ atts }"
+            atts = +" href=\"#{ htmlesc url }#{ slash }\"#{ atts }"
             atts << " title=\"#{ htmlesc title }\"" if title
             atts = shelve( atts ) if atts
             
@@ -962,7 +962,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);
@@ -973,7 +973,7 @@ class RedCloth3 < String
 
             next m unless uri_with_safe_scheme?(url)
 
-            out = ''
+            out = +''
             out << "<a#{ shelve( " href=\"#{ href }\"" ) }>" if href
             out << "<img#{ shelve( atts ) } />"
             out << "</a>#{ href_a1 }#{ href_a2 }" if href
@@ -1096,25 +1096,25 @@ class RedCloth3 < String
                     if codepre - used_offtags.length > 0
                         htmlesc( line, :NoQuotes ) if escape_line
                         @pre_list.last << line
-                        line = ""
+                        line = +""
                     else
                         ### htmlesc is disabled between CODE tags which will be parsed with highlighter
                         ### Regexp in formatter.rb is : /<code\s+class="(\w+)">\s?(.+)/m
                         ### 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.match(/<#{ OFFTAGS }([^>]*)>/)
                         tag = $1
                         $2.to_s.match(/(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
                         htmlesc( line, :NoQuotes ) if escape_line
                         @pre_list.last << line
-                        line = ""
+                        line = +""
                     end
                     codepre -= 1 unless codepre.zero?
                     used_offtags = {} if codepre.zero?