Corrected with rubocop cop 'Lint/NonLocalExitFromIterator'.

This commit is contained in:
Thorsten Eckel 2015-05-05 16:36:05 +02:00
parent b08a817e3d
commit ba2d2e8296
6 changed files with 16 additions and 11 deletions

View file

@ -250,8 +250,6 @@ Style/SpaceBeforeComment:
Enabled: false
Lint/UselessAssignment:
Enabled: false
Lint/NonLocalExitFromIterator:
Enabled: false
Rails/Date:
Enabled: false
Lint/UnreachableCode:

View file

@ -239,21 +239,21 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
result = email_probe_inbound( settings[:inbound] )
if result[:result] != 'ok'
render json: result
return
return # rubocop:disable Lint/NonLocalExitFromIterator
end
# probe outbound
result = email_probe_outbound( settings[:outbound], params[:email] )
if result[:result] != 'ok'
render json: result
return
return # rubocop:disable Lint/NonLocalExitFromIterator
end
render json: {
result: 'ok',
setting: settings,
}
return
return # rubocop:disable Lint/NonLocalExitFromIterator
end
}
}
@ -632,7 +632,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
message: e.to_s,
subject: subject,
}
return
return # rubocop:disable Lint/NonLocalExitFromIterator
end
if found && found == 'verify ok'
@ -693,7 +693,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
render json: {
result: 'ok',
}
return
return # rubocop:disable Lint/NonLocalExitFromIterator
end
}

View file

@ -56,7 +56,7 @@ class ImportOtrsController < ApplicationController
url: url,
result: 'ok',
}
return
return # rubocop:disable Lint/NonLocalExitFromIterator
elsif response.body =~ /(otrs\sag|otrs.com|otrs.org)/i
message_human = 'Host found, but no OTRS migrator is installed!'
end

View file

@ -41,7 +41,7 @@ returns
# load backend
backend = self.load_adapter( config_item[:adapter] )
return if !backend
next if !backend
user_auth = backend.check( username, password, config_item, user )

View file

@ -32,9 +32,16 @@ class Sessions::Backend::Collections::Base
return if !access
end
if self.class.is_not_role
is_role = false
self.class.is_not_role.each {|role|
return if @user.is_role(role)
next if !@user.is_role(role)
is_role = true
break
}
return if is_role
end
# check timeout

View file

@ -52,7 +52,7 @@ returns
# load backend
backend = self.load_adapter( config_item[:adapter] )
return if !backend
next if !backend
user_auth = backend.check( params, config_item )