Corrected with rubocop cop 'Style/ColonMethodCall'.

This commit is contained in:
Thorsten Eckel 2015-05-05 16:25:28 +02:00
parent 50806a4b5e
commit b08a817e3d
7 changed files with 16 additions and 18 deletions

View file

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

View file

@ -891,7 +891,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
begin
mxs = Resolv::DNS.open do |dns|
ress = dns.getresources(domain, Resolv::DNS::Resource::IN::MX)
ress.map { |r| [r.exchange.to_s, IPSocket::getaddress(r.exchange.to_s), r.preference] }
ress.map { |r| [r.exchange.to_s, IPSocket.getaddress(r.exchange.to_s), r.preference] }
end
rescue Exception => e
logger.error e.message

View file

@ -34,13 +34,13 @@ class SessionsController < ApplicationController
user.activity_stream_log( 'session started', user.id, true )
# auto population of default collections
collections, assets = SessionHelper::default_collections(user)
collections, assets = SessionHelper.default_collections(user)
# add session user assets
assets = user.assets(assets)
# get models
models = SessionHelper::models(user)
models = SessionHelper.models(user)
# check logon session
logon_session_key = nil
@ -76,7 +76,7 @@ class SessionsController < ApplicationController
# check logon session
if params['logon_session']
session = SessionHelper::get( params['logon_session'] )
session = SessionHelper.get( params['logon_session'] )
if session
user_id = session.data[:user_id]
end
@ -84,7 +84,7 @@ class SessionsController < ApplicationController
if !user_id
# get models
models = SessionHelper::models()
models = SessionHelper.models()
render json: {
error: 'no valid session',
@ -102,13 +102,13 @@ class SessionsController < ApplicationController
user = User.find( user_id )
# auto population of default collections
collections, assets = SessionHelper::default_collections(user)
collections, assets = SessionHelper.default_collections(user)
# add session user assets
assets = user.assets(assets)
# get models
models = SessionHelper::models(user)
models = SessionHelper.models(user)
# return current session
render json: {
@ -278,7 +278,7 @@ class SessionsController < ApplicationController
def delete
return if deny_if_not_role(Z_ROLENAME_ADMIN)
SessionHelper::destroy( params[:id] )
SessionHelper.destroy( params[:id] )
render json: {}
end

View file

@ -12,7 +12,7 @@ class GeoIp::ZammadGeoIp
# do lookup
host = 'https://geo.zammad.com'
url = "/lookup?ip=#{CGI::escape address}"
url = "/lookup?ip=#{CGI.escape address}"
data = {}
begin
response = UserAgent.get(

View file

@ -3,7 +3,7 @@
class GeoLocation::Gmaps
def self.geocode(address)
url = "http://maps.googleapis.com/maps/api/geocode/json?address=#{CGI::escape address}&sensor=true"
url = "http://maps.googleapis.com/maps/api/geocode/json?address=#{CGI.escape address}&sensor=true"
response = UserAgent.get(url)
return if !response.success?

View file

@ -211,7 +211,7 @@ module Import::OTRS
def self.ticket(ticket_ids)
url = 'public.pl?Action=Export;Type=Ticket;'
ticket_ids.each {|ticket_id|
url = url + "TicketID=#{CGI::escape ticket_id};"
url = url + "TicketID=#{CGI.escape ticket_id};"
}
response = request( url )
return if !response

View file

@ -47,7 +47,7 @@ returns
}
# destory old session if needed
if File::exist?( path )
if File.exist?( path )
Sessions.destory(client_id)
end
@ -82,7 +82,7 @@ returns
path = "#{@path}/"
# just make sure that spool path exists
if !File::exist?( path )
if !File.exist?( path )
FileUtils.mkpath path
end
@ -293,7 +293,7 @@ returns
check = true
count = 0
while check
if File::exist?( path + filename )
if File.exist?( path + filename )
count += 1
filename = "#{filename}-#{count}"
else
@ -445,7 +445,7 @@ returns
}
files.sort.each {|entry|
filename = "#{path}/#{entry}"
next if !File::exist?( filename )
next if !File.exist?( filename )
File.open( filename, 'rb' ) { |file|
all = file.read
spool = JSON.parse( all )
@ -500,7 +500,7 @@ returns
def self.jobs
# just make sure that spool path exists
if !File::exist?( @path )
if !File.exist?( @path )
FileUtils.mkpath @path
end