mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
code cleanup: rubocop: fix Style/AsciiComments in lib/redmine/search.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18631 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
91c56e2cbd
commit
171c62f02d
@ -992,7 +992,6 @@ Style/AndOr:
|
|||||||
Style/AsciiComments:
|
Style/AsciiComments:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'app/models/repository/git.rb'
|
- 'app/models/repository/git.rb'
|
||||||
- 'lib/redmine/search.rb'
|
|
||||||
|
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
# Configuration parameters: EnforcedStyle.
|
# Configuration parameters: EnforcedStyle.
|
||||||
|
|||||||
@ -62,7 +62,7 @@ module Redmine
|
|||||||
# eg. hello "bye bye" => ["hello", "bye bye"]
|
# eg. hello "bye bye" => ["hello", "bye bye"]
|
||||||
@tokens = @question.scan(%r{((\s|^)"[^"]+"(\s|$)|\S+)}).collect {|m| m.first.gsub(%r{(^\s*"\s*|\s*"\s*$)}, '')}
|
@tokens = @question.scan(%r{((\s|^)"[^"]+"(\s|$)|\S+)}).collect {|m| m.first.gsub(%r{(^\s*"\s*|\s*"\s*$)}, '')}
|
||||||
# tokens must be at least 2 characters long
|
# tokens must be at least 2 characters long
|
||||||
# but for Chinese characters (汉字/漢字), tokens can be one character
|
# but for Chinese characters (Chinese HANZI/Japanese KANJI), tokens can be one character
|
||||||
@tokens = @tokens.uniq.select {|w| w.length > 1 || w =~ /\p{Han}/ }
|
@tokens = @tokens.uniq.select {|w| w.length > 1 || w =~ /\p{Han}/ }
|
||||||
# no more than 5 tokens to search for
|
# no more than 5 tokens to search for
|
||||||
@tokens.slice! 5..-1
|
@tokens.slice! 5..-1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user