summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-08-12 08:36:05 +0000
committerGo MAEDA <maeda@farend.jp>2024-08-12 08:36:05 +0000
commit6e21ae720909f9980e58c9411fb9ed8a81f06833 (patch)
treecdf11a115134b45344fe180f829c1686981b47b1 /lib
parentb224d878c33d24df81650667d18035652a18911f (diff)
downloadredmine-6e21ae720909f9980e58c9411fb9ed8a81f06833.tar.gz
redmine-6e21ae720909f9980e58c9411fb9ed8a81f06833.zip
Fix RuboCop offense Layout/SpaceAfterComma, one of the offenses enabled in rubocop-rails-omakase (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@22953 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/configuration.rb2
-rw-r--r--lib/redmine/helpers/time_report.rb4
-rw-r--r--lib/redmine/imap.rb2
-rw-r--r--lib/redmine/pop3.rb2
-rw-r--r--lib/redmine/project_jump_box.rb2
-rw-r--r--lib/redmine/safe_attributes.rb2
-rw-r--r--lib/redmine/scm/adapters/cvs_adapter.rb6
-rw-r--r--lib/redmine/sort_criteria.rb8
-rw-r--r--lib/redmine/wiki_formatting/textile/redcloth3.rb16
9 files changed, 22 insertions, 22 deletions
diff --git a/lib/redmine/configuration.rb b/lib/redmine/configuration.rb
index b1ce9e374..1c7fdb3a5 100644
--- a/lib/redmine/configuration.rb
+++ b/lib/redmine/configuration.rb
@@ -84,7 +84,7 @@ module Redmine
def with(settings)
settings.stringify_keys!
load unless @config
- was = settings.keys.inject({}) {|h,v| h[v] = @config[v]; h}
+ was = settings.keys.inject({}) {|h, v| h[v] = @config[v]; h}
@config.merge! settings
yield if block_given?
@config.merge! was
diff --git a/lib/redmine/helpers/time_report.rb b/lib/redmine/helpers/time_report.rb
index d6512ffe0..935ba6c20 100644
--- a/lib/redmine/helpers/time_report.rb
+++ b/lib/redmine/helpers/time_report.rb
@@ -28,7 +28,7 @@ module Redmine
@criteria = criteria || []
@criteria = @criteria.select{|criteria| available_criteria.has_key? criteria}
@criteria.uniq!
- @criteria = @criteria[0,3]
+ @criteria = @criteria[0, 3]
@columns = (columns && %w(year month week day).include?(columns)) ? columns : 'month'
@scope = time_entry_scope
@@ -77,7 +77,7 @@ module Redmine
max = @hours.pluck('spent_on').max
@to = max ? max.to_date : User.current.today
- @total_hours = @hours.inject(0) {|s,k| s = s + k['hours'].to_f}
+ @total_hours = @hours.inject(0) {|s, k| s = s + k['hours'].to_f}
@periods = []
# Date#at_beginning_of_ not supported in Rails 1.2.x
diff --git a/lib/redmine/imap.rb b/lib/redmine/imap.rb
index cb91bf566..cc8dcb376 100644
--- a/lib/redmine/imap.rb
+++ b/lib/redmine/imap.rb
@@ -36,7 +36,7 @@ module Redmine
imap.login(imap_options[:username], imap_options[:password]) unless imap_options[:username].nil?
imap.select(folder)
imap.uid_search(['NOT', 'SEEN']).each do |uid|
- msg = imap.uid_fetch(uid,'RFC822')[0].attr['RFC822']
+ msg = imap.uid_fetch(uid, 'RFC822')[0].attr['RFC822']
logger.debug "Receiving message #{uid}" if logger && logger.debug?
if MailHandler.safe_receive(msg, options)
logger.debug "Message #{uid} successfully received" if logger && logger.debug?
diff --git a/lib/redmine/pop3.rb b/lib/redmine/pop3.rb
index 6035c4c11..e06c2296c 100644
--- a/lib/redmine/pop3.rb
+++ b/lib/redmine/pop3.rb
@@ -40,7 +40,7 @@ module Redmine
apop = (pop_options[:apop].to_s == '1')
delete_unprocessed = (pop_options[:delete_unprocessed].to_s == '1')
- pop = Net::POP3.APOP(apop).new(host,port)
+ pop = Net::POP3.APOP(apop).new(host, port)
logger.debug "Connecting to #{host}..." if logger && logger.debug?
pop.start(pop_options[:username], pop_options[:password]) do |pop_session|
if pop_session.mails.empty?
diff --git a/lib/redmine/project_jump_box.rb b/lib/redmine/project_jump_box.rb
index 1d00c8f9c..54da4a514 100644
--- a/lib/redmine/project_jump_box.rb
+++ b/lib/redmine/project_jump_box.rb
@@ -77,7 +77,7 @@ module Redmine
end
def recently_used_project_ids
- pref_project_ids(:recently_used_project_ids)[0,recent_projects_count]
+ pref_project_ids(:recently_used_project_ids)[0, recent_projects_count]
end
def recently_used_project_ids=(new_ids)
diff --git a/lib/redmine/safe_attributes.rb b/lib/redmine/safe_attributes.rb
index 387b93e25..095e18195 100644
--- a/lib/redmine/safe_attributes.rb
+++ b/lib/redmine/safe_attributes.rb
@@ -76,7 +76,7 @@ module Redmine
# # => {'title' => 'My book'}
def delete_unsafe_attributes(attrs, user=User.current)
safe = safe_attribute_names(user)
- attrs.dup.delete_if {|k,v| !safe.include?(k.to_s)}
+ attrs.dup.delete_if {|k, v| !safe.include?(k.to_s)}
end
# Sets attributes from attrs that are safe
diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb
index 92bae7a06..b8cc97001 100644
--- a/lib/redmine/scm/adapters/cvs_adapter.rb
+++ b/lib/redmine/scm/adapters/cvs_adapter.rb
@@ -94,7 +94,7 @@ module Redmine
cmd_args << path_with_proj(path)
scm_cmd(*cmd_args) do |io|
io.each_line() do |line|
- fields = line.chop.split('/',-1)
+ fields = line.chop.split('/', -1)
logger.debug(">>InspectLine #{fields.inspect}")
if fields[0]!="D"
time = nil
@@ -362,11 +362,11 @@ module Redmine
end
def normalize_cvs_path(path)
- normalize_path(path.gsub("Attic/",''))
+ normalize_path(path.gsub("Attic/", ''))
end
def normalize_path(path)
- path.sub(/^(\/)*(.*)/,'\2').sub(/(.*)(,v)+/,'\1')
+ path.sub(/^(\/)*(.*)/, '\2').sub(/(.*)(,v)+/, '\1')
end
def path_with_proj(path)
diff --git a/lib/redmine/sort_criteria.rb b/lib/redmine/sort_criteria.rb
index 1825197eb..461cd3ac1 100644
--- a/lib/redmine/sort_criteria.rb
+++ b/lib/redmine/sort_criteria.rb
@@ -34,7 +34,7 @@ module Redmine
end
def to_param
- self.collect {|k,o| k + (o == 'desc' ? ':desc' : '')}.join(',')
+ self.collect {|k, o| k + (o == 'desc' ? ':desc' : '')}.join(',')
end
def to_a
@@ -43,7 +43,7 @@ module Redmine
def add!(key, asc)
key = key.to_s
- delete_if {|k,o| k == key}
+ delete_if {|k, o| k == key}
prepend([key, asc])
normalize!
end
@@ -74,10 +74,10 @@ module Redmine
def sort_clause(sortable_columns)
if sortable_columns.is_a?(Array)
- sortable_columns = sortable_columns.inject({}) {|h,k| h[k]=k; h}
+ sortable_columns = sortable_columns.inject({}) {|h, k| h[k]=k; h}
end
- sql = self.collect do |k,o|
+ sql = self.collect do |k, o|
if s = sortable_columns[k]
s = [s] unless s.is_a?(Array)
s.collect {|c| append_order(c, o)}
diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb
index 3bc8ea29d..8667b2f09 100644
--- a/lib/redmine/wiki_formatting/textile/redcloth3.rb
+++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb
@@ -563,7 +563,7 @@ class RedCloth3 < String
depth = []
lines.each_with_index do |line, line_id|
if line =~ LISTS_CONTENT_RE
- tl,atts,content = $~[1..3]
+ tl, atts, content = $~[1..3]
if depth.last
if depth.last.length > tl.length
(depth.length - 1).downto(0) do |i|
@@ -608,7 +608,7 @@ class RedCloth3 < String
indent = 0
lines.each do |line|
line =~ QUOTES_CONTENT_RE
- bq,content = $1, $2
+ bq, content = $1, $2
l = bq.count('>')
if l != indent
quotes << ("\n\n" + (l>indent ? '<blockquote>' * (l-indent) : '</blockquote>' * (indent-l)) + "\n\n")
@@ -630,7 +630,7 @@ class RedCloth3 < String
def inline_textile_code( text )
text.gsub!( CODE_RE ) do |m|
- before,lang,code,after = $~[1..4]
+ before, lang, code, after = $~[1..4]
lang = " lang=\"#{lang}\"" if lang
rip_offtags( +"#{before}<code#{lang}>#{code}</code>#{after}", false )
end
@@ -719,7 +719,7 @@ class RedCloth3 < String
def block_textile_prefix( text )
if text =~ BLOCK_RE
- tag,tagpre,num,atts,cite,content = $~[1..6]
+ tag, tagpre, num, atts, cite, content = $~[1..6]
atts = pba( atts )
# pass to prefix handler
@@ -789,13 +789,13 @@ class RedCloth3 < String
text.gsub!( qtag_re ) do |m|
case rtype
when :limit
- sta,oqs,qtag,content,oqa = $~[1..6]
+ sta, oqs, qtag, content, oqa = $~[1..6]
atts = nil
if content =~ /^(#{C})(.+)$/o
atts, content = $~[1..2]
end
else
- qtag,atts,cite,content = $~[1..4]
+ qtag, atts, cite, content = $~[1..4]
sta = ''
end
atts = pba( atts )
@@ -827,7 +827,7 @@ class RedCloth3 < String
def inline_textile_link( text )
text.gsub!( LINK_RE ) do |m|
- all,pre,atts,text,title,url,proto,slash,post = $~[1..9]
+ all, pre, atts, text, title, url, proto, slash, post = $~[1..9]
if text.include?('<br />')
all
else
@@ -950,7 +950,7 @@ class RedCloth3 < String
def inline_textile_image( text )
text.gsub!( IMAGE_RE ) do |m|
- stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8]
+ stln, algn, atts, url, title, href, href_a1, href_a2 = $~[1..8]
htmlesc title
atts = pba( atts )
atts = +" src=\"#{htmlesc url.dup}\"#{atts}"