Corrected with rubocop cop 'Lint/AmbiguousRegexpLiteral'.
This commit is contained in:
parent
9cd4bb748a
commit
07db8b35d9
3 changed files with 8 additions and 10 deletions
|
@ -264,8 +264,6 @@ Lint/ShadowingOuterLocalVariable:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Style/InfiniteLoop:
|
Style/InfiniteLoop:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Lint/AmbiguousRegexpLiteral:
|
|
||||||
Enabled: false
|
|
||||||
Lint/Eval:
|
Lint/Eval:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Style/ModuleFunction:
|
Style/ModuleFunction:
|
||||||
|
|
|
@ -38,7 +38,7 @@ class TicketsController < ApplicationController
|
||||||
|
|
||||||
# create tags if given
|
# create tags if given
|
||||||
if params[:tags] && !params[:tags].empty?
|
if params[:tags] && !params[:tags].empty?
|
||||||
tags = params[:tags].split /,/
|
tags = params[:tags].split(/,/)
|
||||||
tags.each {|tag|
|
tags.each {|tag|
|
||||||
Tag.tag_add(
|
Tag.tag_add(
|
||||||
object: 'Ticket',
|
object: 'Ticket',
|
||||||
|
|
|
@ -56,17 +56,17 @@ returns
|
||||||
ticket_subject_size = Setting.get('ticket_subject_size')
|
ticket_subject_size = Setting.get('ticket_subject_size')
|
||||||
|
|
||||||
# remove all possible ticket hook formats with []
|
# remove all possible ticket hook formats with []
|
||||||
subject = subject.gsub /\[#{ticket_hook}: #{self.number}\](\s+?|)/, ''
|
subject = subject.gsub(/\[#{ticket_hook}: #{self.number}\](\s+?|)/, '')
|
||||||
subject = subject.gsub /\[#{ticket_hook}:#{self.number}\](\s+?|)/, ''
|
subject = subject.gsub(/\[#{ticket_hook}:#{self.number}\](\s+?|)/, '')
|
||||||
subject = subject.gsub /\[#{ticket_hook}#{ticket_hook_divider}#{self.number}\](\s+?|)/, ''
|
subject = subject.gsub(/\[#{ticket_hook}#{ticket_hook_divider}#{self.number}\](\s+?|)/, '')
|
||||||
|
|
||||||
# remove all possible ticket hook formats without []
|
# remove all possible ticket hook formats without []
|
||||||
subject = subject.gsub /#{ticket_hook}: #{self.number}(\s+?|)/, ''
|
subject = subject.gsub(/#{ticket_hook}: #{self.number}(\s+?|)/, '')
|
||||||
subject = subject.gsub /#{ticket_hook}:#{self.number}(\s+?|)/, ''
|
subject = subject.gsub(/#{ticket_hook}:#{self.number}(\s+?|)/, '')
|
||||||
subject = subject.gsub /#{ticket_hook}#{ticket_hook_divider}#{self.number}(\s+?|)/, ''
|
subject = subject.gsub(/#{ticket_hook}#{ticket_hook_divider}#{self.number}(\s+?|)/, '')
|
||||||
|
|
||||||
# remove leading "..:\s" and "..[\d+]:\s" e. g. "Re: " or "Re[5]: "
|
# remove leading "..:\s" and "..[\d+]:\s" e. g. "Re: " or "Re[5]: "
|
||||||
subject = subject.gsub /^(..(\[\d+\])?:\s)+/, ''
|
subject = subject.gsub(/^(..(\[\d+\])?:\s)+/, '')
|
||||||
|
|
||||||
# resize subject based on config
|
# resize subject based on config
|
||||||
if subject.length > ticket_subject_size.to_i
|
if subject.length > ticket_subject_size.to_i
|
||||||
|
|
Loading…
Reference in a new issue