Merge branch 'develop' of github.com:martini/zammad into develop
This commit is contained in:
commit
700616f5e2
10 changed files with 116 additions and 31 deletions
103
.rubocop.yml
103
.rubocop.yml
|
@ -1,12 +1,16 @@
|
|||
AllCops:
|
||||
RunRailsCops: true
|
||||
|
||||
# Default enabled
|
||||
# Default enabled cops
|
||||
# https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
|
||||
|
||||
# TODO:
|
||||
# https://github.com/bbatsov/rubocop#includingexcluding-files
|
||||
|
||||
AllCops:
|
||||
RunRailsCops: true
|
||||
Exclude:
|
||||
- 'bin/rails'
|
||||
- 'bin/rake'
|
||||
- 'bin/spring'
|
||||
- 'db/schema.rb'
|
||||
|
||||
Metrics/LineLength:
|
||||
Description: 'Limit lines to 80 characters.'
|
||||
|
@ -131,7 +135,6 @@ Style/SelfAssignment:
|
|||
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
||||
Enabled: false
|
||||
|
||||
# [Corrected] Redundant curly braces around a hash parameter.
|
||||
Style/BracesAroundHashParameters:
|
||||
Description: 'Enforce braces style around hash parameters.'
|
||||
Enabled: false
|
||||
|
@ -141,10 +144,7 @@ Rails/FindEach:
|
|||
Enabled: false
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# TODO
|
||||
|
||||
Style/Documentation:
|
||||
Description: 'Document classes and non-namespace modules.'
|
||||
|
@ -202,3 +202,88 @@ Metrics/AbcSize:
|
|||
A calculated magnitude based on number of assignments,
|
||||
branches, and conditions.
|
||||
Enabled: false
|
||||
|
||||
Style/RedundantSelf:
|
||||
Enabled: false
|
||||
Style/Next:
|
||||
Enabled: false
|
||||
Rails/Output:
|
||||
Enabled: false
|
||||
Lint/UselessAccessModifier:
|
||||
Enabled: false
|
||||
Style/CommentIndentation:
|
||||
Enabled: false
|
||||
Metrics/CyclomaticComplexity:
|
||||
Enabled: false
|
||||
Style/ClassAndModuleChildren:
|
||||
Enabled: false
|
||||
Lint/StringConversionInInterpolation:
|
||||
Enabled: false
|
||||
Metrics/PerceivedComplexity:
|
||||
Enabled: false
|
||||
Style/FileName:
|
||||
Enabled: false
|
||||
Style/GlobalVars:
|
||||
Enabled: false
|
||||
Rails/TimeZone:
|
||||
Enabled: false
|
||||
Rails/TimeZone:
|
||||
Enabled: false
|
||||
Metrics/BlockNesting:
|
||||
Enabled: false
|
||||
Lint/RescueException:
|
||||
Enabled: false
|
||||
Style/EachWithObject:
|
||||
Enabled: false
|
||||
Style/PredicateName:
|
||||
Enabled: false
|
||||
Style/ClassVars:
|
||||
Enabled: false
|
||||
Lint/LiteralInCondition:
|
||||
Enabled: false
|
||||
Style/PredicateName:
|
||||
Enabled: false
|
||||
Style/SpaceBeforeComment:
|
||||
Enabled: false
|
||||
Lint/UselessAssignment:
|
||||
Enabled: false
|
||||
Lint/NonLocalExitFromIterator:
|
||||
Enabled: false
|
||||
Style/ColonMethodCall:
|
||||
Enabled: false
|
||||
Rails/Date:
|
||||
Enabled: false
|
||||
Style/VariableName:
|
||||
Enabled: false
|
||||
Lint/UnreachableCode:
|
||||
Enabled: false
|
||||
Lint/ShadowingOuterLocalVariable:
|
||||
Enabled: false
|
||||
Style/InfiniteLoop:
|
||||
Enabled: false
|
||||
Lint/AmbiguousRegexpLiteral:
|
||||
Enabled: false
|
||||
Rails/Validation:
|
||||
Enabled: false
|
||||
Style/MultilineOperationIndentation:
|
||||
Enabled: false
|
||||
Style/OneLineConditional:
|
||||
Enabled: false
|
||||
Style/ClassMethods:
|
||||
Enabled: false
|
||||
Lint/Eval:
|
||||
Enabled: false
|
||||
Rails/HasAndBelongsToMany:
|
||||
Enabled: false
|
||||
Style/MethodName:
|
||||
Enabled: false
|
||||
Style/ModuleFunction:
|
||||
Enabled: false
|
||||
Style/AccessModifierIndentation:
|
||||
Enabled: false
|
||||
Lint/Loop:
|
||||
Enabled: false
|
||||
Style/For:
|
||||
Enabled: false
|
||||
Style/WhileUntilDo:
|
||||
Enabled: false
|
||||
|
|
|
@ -93,7 +93,7 @@ class ImportOtrsController < ApplicationController
|
|||
def import_status
|
||||
return if setup_done_response
|
||||
|
||||
state = Import::OTRS2.get_current_state
|
||||
state = Import::OTRS2.current_state
|
||||
|
||||
render json: {
|
||||
data: state,
|
||||
|
|
|
@ -116,7 +116,7 @@ class Scheduler < ApplicationModel
|
|||
sleep(wait)
|
||||
logger.info '*** worker loop'
|
||||
else
|
||||
printf "*** #{count} jobs processed at %.4f j/s, %d failed ...\n" % [count / realtime, result.last]
|
||||
format "*** #{count} jobs processed at %.4f j/s, %d failed ...\n", count / realtime, result.last
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ module Ticket::Number::Date
|
|||
end
|
||||
|
||||
system_id = Setting.get('system_id') || ''
|
||||
number = t.strftime('%Y%m%d') + system_id.to_s + sprintf( '%04d', counter_increment)
|
||||
number = t.strftime('%Y%m%d') + system_id.to_s + format('%04d', counter_increment)
|
||||
|
||||
# calculate a checksum
|
||||
# The algorithm to calculate the checksum is derived from the one
|
||||
|
|
|
@ -212,9 +212,9 @@ module Import::OTRS2
|
|||
|
||||
=begin
|
||||
|
||||
get object statisitic from server ans save it in cache
|
||||
get object statistic from server ans save it in cache
|
||||
|
||||
result = get_statisitic('Subaction=List')
|
||||
result = statistic('Subaction=List')
|
||||
|
||||
return
|
||||
|
||||
|
@ -226,7 +226,7 @@ module Import::OTRS2
|
|||
|
||||
=end
|
||||
|
||||
def self.get_statisitic
|
||||
def self.statistic
|
||||
|
||||
# check cache
|
||||
cache = Cache.get('import_otrs_stats')
|
||||
|
@ -246,7 +246,7 @@ module Import::OTRS2
|
|||
|
||||
return current import state
|
||||
|
||||
result = get_current_state
|
||||
result = current_state
|
||||
|
||||
return
|
||||
|
||||
|
@ -263,8 +263,8 @@ module Import::OTRS2
|
|||
|
||||
=end
|
||||
|
||||
def self.get_current_state
|
||||
data = self.get_statisitic
|
||||
def self.current_state
|
||||
data = self.statistic
|
||||
base = Group.count + Ticket::State.count + Ticket::Priority.count
|
||||
base_total = data['Queue'] + data['State'] + data['Priority']
|
||||
user = User.count
|
||||
|
|
|
@ -77,8 +77,8 @@ class TestCase < Test::Unit::TestCase
|
|||
def screenshot(params)
|
||||
instance = params[:browser] || @browser
|
||||
comment = params[:comment] || ''
|
||||
filename = "tmp/#{Time.zone.now.strftime("screenshot_%Y_%m_%d__%H_%M_%S")}_#{comment}_#{instance.hash}.png"
|
||||
log('screenshot', {filename: filename})
|
||||
filename = "tmp/#{Time.zone.now.strftime('screenshot_%Y_%m_%d__%H_%M_%S')}_#{comment}_#{instance.hash}.png"
|
||||
log('screenshot', { filename: filename })
|
||||
instance.save_screenshot(filename)
|
||||
end
|
||||
|
||||
|
|
|
@ -45,13 +45,13 @@ class ActiveSupport::TestCase
|
|||
puts 'teardown'
|
||||
|
||||
# check if jobs are proccessed
|
||||
if !Delayed::Job.all.empty?
|
||||
return if Delayed::Job.all.empty?
|
||||
|
||||
Delayed::Job.where('failed_at != NULL').each {|job|
|
||||
assert( false, "not processable job #{jobs.inspect}" )
|
||||
}
|
||||
Delayed::Job.all.destroy_all
|
||||
end
|
||||
end
|
||||
|
||||
# Add more helper methods to be used by all tests here...
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue