diff options
author | Go MAEDA <maeda@farend.jp> | 2023-12-20 09:23:05 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-12-20 09:23:05 +0000 |
commit | 380444f085d95656347cb4e62d41e851ca8494b9 (patch) | |
tree | 29b59c9e08ff8236b3abdde6396ed704fd68092b /lib | |
parent | 21a48d79f4f116a59283803475a5799e83da6074 (diff) | |
download | redmine-380444f085d95656347cb4e62d41e851ca8494b9.tar.gz redmine-380444f085d95656347cb4e62d41e851ca8494b9.zip |
Fix RuboCop offense Performance/StringIdentifierArgument (#39888).
git-svn-id: https://svn.redmine.org/redmine/trunk@22535 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/ciphering.rb | 2 | ||||
-rw-r--r-- | lib/redmine/configuration.rb | 2 | ||||
-rw-r--r-- | lib/redmine/helpers/gantt.rb | 8 | ||||
-rw-r--r-- | lib/redmine/plugin.rb | 2 | ||||
-rw-r--r-- | lib/redmine/wiki_formatting/textile/redcloth3.rb | 10 |
5 files changed, 12 insertions, 12 deletions
diff --git a/lib/redmine/ciphering.rb b/lib/redmine/ciphering.rb index 2806ae14d..f3397446f 100644 --- a/lib/redmine/ciphering.rb +++ b/lib/redmine/ciphering.rb @@ -73,7 +73,7 @@ module Redmine transaction do all.each do |object| clear = object.send(attribute) - object.send "#{attribute}=", clear + object.send :"#{attribute}=", clear raise(ActiveRecord::Rollback) unless object.save(validate: false) end end ? true : false diff --git a/lib/redmine/configuration.rb b/lib/redmine/configuration.rb index 3e604cab3..43506836f 100644 --- a/lib/redmine/configuration.rb +++ b/lib/redmine/configuration.rb @@ -66,7 +66,7 @@ module Redmine "Please update your config/configuration.yml to use :#$1 delivery method instead." end v.symbolize_keys! if v.respond_to?(:symbolize_keys!) - ActionMailer::Base.send("#{k}=", v) + ActionMailer::Base.send(:"#{k}=", v) end end diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index b33fc3223..a7b0d715d 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -270,8 +270,8 @@ module Redmine def render_object_row(object, options) class_name = object.class.name.downcase - send("subject_for_#{class_name}", object, options) unless options[:only] == :lines || options[:only] == :selected_columns - send("line_for_#{class_name}", object, options) unless options[:only] == :subjects || options[:only] == :selected_columns + send(:"subject_for_#{class_name}", object, options) unless options[:only] == :lines || options[:only] == :selected_columns + send(:"line_for_#{class_name}", object, options) unless options[:only] == :subjects || options[:only] == :selected_columns column_content_for_issue(object, options) if options[:only] == :selected_columns && options[:column].present? && object.is_a?(Issue) options[:top] += options[:top_increment] @number_of_rows += 1 @@ -361,14 +361,14 @@ module Redmine end def subject(label, options, object=nil) - send "#{options[:format]}_subject", options, label, object + send :"#{options[:format]}_subject", options, label, object end def line(start_date, end_date, done_ratio, markers, label, options, object=nil) options[:zoom] ||= 1 options[:g_width] ||= (self.date_to - self.date_from + 1) * options[:zoom] coords = coordinates(start_date, end_date, done_ratio, options[:zoom]) - send "#{options[:format]}_task", options, coords, markers, label, object + send :"#{options[:format]}_task", options, coords, markers, label, object end # Generates a gantt image diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index 0fb762de9..8107a5a39 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -71,7 +71,7 @@ module Redmine class_eval do names.each do |name| define_method(name) do |*args| - args.empty? ? instance_variable_get("@#{name}") : instance_variable_set("@#{name}", *args) + args.empty? ? instance_variable_get(:"@#{name}") : instance_variable_set(:"@#{name}", *args) end end end diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb index e319d90db..f545bdf91 100644 --- a/lib/redmine/wiki_formatting/textile/redcloth3.rb +++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb @@ -255,7 +255,7 @@ class RedCloth3 < String # #=>"<h1>A <b>bold</b> man</h1>" # def initialize( string, restrictions = [] ) - restrictions.each { |r| method( "#{r}=" ).call( true ) } + restrictions.each { |r| method( :"#{r}=" ).call( true ) } super( string ) end @@ -724,10 +724,10 @@ class RedCloth3 < String # pass to prefix handler replacement = nil - if respond_to? "textile_#{tag}", true - replacement = method( "textile_#{tag}" ).call( tag, atts, cite, content ) - elsif respond_to? "textile_#{tagpre}_", true - replacement = method( "textile_#{tagpre}_" ).call( tagpre, num, atts, cite, content ) + if respond_to? :"textile_#{tag}", true + replacement = method( :"textile_#{tag}" ).call( tag, atts, cite, content ) + elsif respond_to? :"textile_#{tagpre}_", true + replacement = method( :"textile_#{tagpre}_" ).call( tagpre, num, atts, cite, content ) end text.gsub!( $& ) { replacement } if replacement end |