Skip to content
Permalink
Browse files

Maintenance: Applied rubocop Performance/Casecmp.

  • Loading branch information...
thorsteneckel committed Sep 5, 2019
1 parent f50c079 commit 9c76def19d914843373149a782f0d0a942e686b2
@@ -47,14 +47,6 @@ Metrics/ModuleLength:
Metrics/PerceivedComplexity:
Max: 115

# Offense count: 3
# Cop supports --auto-correct.
Performance/Casecmp:
Exclude:
- 'app/models/channel/email_parser.rb'
- 'app/models/channel/filter/database.rb'
- 'lib/tasks/zammad/setup/db_config.rake'

# Offense count: 3
# Cop supports --auto-correct.
Rails/ApplicationRecord:
@@ -331,7 +331,7 @@ def self.check_attributes_by_x_headers(header_name, value)
end
return true if !class_name

if class_name.downcase == 'article'
if class_name.casecmp('article').zero?
class_name = 'Ticket::Article'
end
return true if !attribute
@@ -48,7 +48,7 @@ def self.run(_channel, mail)

Rails.logger.info " perform '#{key.downcase}' = '#{meta.inspect}'"

if key.downcase == 'x-zammad-ticket-tags' && meta['value'].present? && meta['operator'].present?
if key.casecmp('x-zammad-ticket-tags').zero? && meta['value'].present? && meta['operator'].present?
mail[ 'x-zammad-ticket-tags'.downcase.to_sym ] ||= []
tags = meta['value'].split(',')

@@ -15,7 +15,7 @@ namespace :zammad do
next if FileUtils.identical?(template, destination)

printf 'config/database.yml: File exists. Overwrite? [y/N] '
next if STDIN.gets.chomp.downcase != 'y'
next if !STDIN.gets.chomp.casecmp('y').zero?
end

FileUtils.cp(template, destination)

0 comments on commit 9c76def

Please sign in to comment.
You can’t perform that action at this time.