From 43a924f5545b925893dd47dd2c1e7f2573dd7105 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 7 May 2015 22:49:15 +0200 Subject: [PATCH] Applied rubocop Style/CommentIndentation. --- app/models/application_model.rb | 3 +-- app/models/object_manager.rb | 1 - .../ticket/article/communicate_twitter.rb | 2 +- app/models/ticket/escalation.rb | 4 ++-- db/migrate/20120101000001_create_base.rb | 4 ++-- db/migrate/20120101000010_create_ticket.rb | 2 +- ...20120101000100_postmaster_filter_create.rb | 3 --- .../20141217000001_update_object_manager2.rb | 1 - lib/application_lib.rb | 8 ++++---- lib/encode.rb | 2 +- lib/import/otrs.rb | 19 +++++++++--------- lib/notification_factory.rb | 20 +++++++++---------- lib/sessions.rb | 2 -- lib/sessions/cache_in.rb | 2 -- lib/time_calculation.rb | 2 +- vendor/lib/facebook_database.rb | 3 +-- vendor/lib/google_oauth2_database.rb | 3 +-- vendor/lib/linked_in_database.rb | 3 +-- vendor/lib/twitter_database.rb | 3 +-- 19 files changed, 36 insertions(+), 51 deletions(-) diff --git a/app/models/application_model.rb b/app/models/application_model.rb index 3b285f586..97d82864c 100644 --- a/app/models/application_model.rb +++ b/app/models/application_model.rb @@ -519,8 +519,7 @@ end def self.notify_clients_support after_create :notify_clients_after_create after_update :notify_clients_after_update -# after_touch :notify_clients_after_touch - after_touch :notify_clients_after_update + after_touch :notify_clients_after_touch after_destroy :notify_clients_after_destroy end diff --git a/app/models/object_manager.rb b/app/models/object_manager.rb index 934626bcf..5dcbf21dc 100644 --- a/app/models/object_manager.rb +++ b/app/models/object_manager.rb @@ -117,7 +117,6 @@ add a new attribute entry for an object name: data[:name], ) if result -# raise "ERROR: attribute #{data[:name]} for #{data[:object]} already exists" return result.update_attributes(data) end diff --git a/app/models/observer/ticket/article/communicate_twitter.rb b/app/models/observer/ticket/article/communicate_twitter.rb index 36fb70f44..9a59b989a 100644 --- a/app/models/observer/ticket/article/communicate_twitter.rb +++ b/app/models/observer/ticket/article/communicate_twitter.rb @@ -25,7 +25,7 @@ class Observer::Ticket::Article::CommunicateTwitter < ActiveRecord::Observer body: record.body, in_reply_to: record.in_reply_to }, - # Rails.application.config.channel_twitter + #Rails.application.config.channel_twitter ) record.message_id = message.id record.save diff --git a/app/models/ticket/escalation.rb b/app/models/ticket/escalation.rb index ef5ee366d..87d63dc64 100644 --- a/app/models/ticket/escalation.rb +++ b/app/models/ticket/escalation.rb @@ -261,8 +261,8 @@ returns if counted # puts "Diff count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}" total_time_without_pending = total_time_without_pending + diff - # else - # puts "Diff not count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}" + # else + # puts "Diff not count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}" end total_time = total_time + diff diff --git a/db/migrate/20120101000001_create_base.rb b/db/migrate/20120101000001_create_base.rb index 976c7fdfe..99427194b 100644 --- a/db/migrate/20120101000001_create_base.rb +++ b/db/migrate/20120101000001_create_base.rb @@ -40,7 +40,7 @@ class CreateBase < ActiveRecord::Migration end add_index :users, [:login], unique: true add_index :users, [:email] -# add_index :users, [:email], :unique => true + #add_index :users, [:email], unique: => true add_index :users, [:image] add_index :users, [:department] add_index :users, [:phone] @@ -74,7 +74,7 @@ class CreateBase < ActiveRecord::Migration create_table :groups do |t| t.references :signature, null: true t.references :email_address, null: true - t.column :name, :string, limit: 100, null: false + t.column :name, :string, limit: 160, null: false t.column :assignment_timeout, :integer, null: true t.column :follow_up_possible, :string, limit: 100, null: false, default: 'yes' t.column :follow_up_assignment, :boolean, null: false, default: true diff --git a/db/migrate/20120101000010_create_ticket.rb b/db/migrate/20120101000010_create_ticket.rb index bcd9be345..ba38be820 100644 --- a/db/migrate/20120101000010_create_ticket.rb +++ b/db/migrate/20120101000010_create_ticket.rb @@ -141,7 +141,7 @@ class CreateTicket < ActiveRecord::Migration t.column :to, :string, limit: 3000, null: true t.column :cc, :string, limit: 3000, null: true t.column :subject, :string, limit: 3000, null: true -# t.column :reply_to, :string, :limit => 3000, :null => true + # t.column :reply_to, :string, :limit => 3000, :null => true t.column :message_id, :string, limit: 3000, null: true t.column :message_id_md5, :string, limit: 32, null: true t.column :in_reply_to, :string, limit: 3000, null: true diff --git a/db/migrate/20120101000100_postmaster_filter_create.rb b/db/migrate/20120101000100_postmaster_filter_create.rb index 3798b4576..7f0702643 100644 --- a/db/migrate/20120101000100_postmaster_filter_create.rb +++ b/db/migrate/20120101000100_postmaster_filter_create.rb @@ -12,9 +12,6 @@ class PostmasterFilterCreate < ActiveRecord::Migration t.timestamps end add_index :postmaster_filters, [:channel] - -# add_column :groups, :email_address_id, :integer, :null => true - end def down diff --git a/db/migrate/20141217000001_update_object_manager2.rb b/db/migrate/20141217000001_update_object_manager2.rb index 5aff4c85d..69e5058a4 100644 --- a/db/migrate/20141217000001_update_object_manager2.rb +++ b/db/migrate/20141217000001_update_object_manager2.rb @@ -497,7 +497,6 @@ class UpdateObjectManager2 < ActiveRecord::Migration maxlength: 250, null: true, note: 'Notes are visible to agents only, never to customers.', -# :item_class => 'formGroup--halfSize', }, editable: false, active: true, diff --git a/lib/application_lib.rb b/lib/application_lib.rb index c0f59c413..a9fa4255f 100644 --- a/lib/application_lib.rb +++ b/lib/application_lib.rb @@ -42,12 +42,12 @@ returns # load adapter # will only work on ruby 2.0 -# Object.const_get(adapter) + #Object.const_get(adapter) # will work on ruby 1.9 and 2.0 -# adapter.split('::').inject(Object) do |mod, class_name| -# mod.const_get(class_name) -# end + #adapter.split('::').inject(Object) do |mod, class_name| + # mod.const_get(class_name) + #end # will work with active_support adapter = adapter.constantize diff --git a/lib/encode.rb b/lib/encode.rb index fd5074f45..31899d8af 100644 --- a/lib/encode.rb +++ b/lib/encode.rb @@ -35,6 +35,6 @@ module Encode Rails.logger.error 'ERROR: ' + e.inspect string end -# Iconv.conv( 'UTF8', charset, string ) + #Iconv.conv( 'UTF8', charset, string ) end end diff --git a/lib/import/otrs.rb b/lib/import/otrs.rb index 92a83afd6..deeee2604 100644 --- a/lib/import/otrs.rb +++ b/lib/import/otrs.rb @@ -481,7 +481,6 @@ module Import::OTRS end def self._ticket_result(result, locks, _thread = '-') -# puts result.inspect map = { Ticket: { Changed: :updated_at, @@ -496,13 +495,13 @@ module Import::OTRS Title: :title, TicketID: :id, FirstResponse: :first_response, -# :FirstResponseTimeDestinationDate => :first_response_escal_date, -# :FirstResponseInMin => :first_response_in_min, -# :FirstResponseDiffInMin => :first_response_diff_in_min, + #FirstResponseTimeDestinationDate: :first_response_escal_date, + #FirstResponseInMin: :first_response_in_min, + #FirstResponseDiffInMin: :first_response_diff_in_min, Closed: :close_time, -# :SoltutionTimeDestinationDate => :close_time_escal_date, -# :CloseTimeInMin => :close_time_in_min, -# :CloseTimeDiffInMin => :close_time_diff_in_min, + #SoltutionTimeDestinationDate: :close_time_escal_date, + #CloseTimeInMin: :close_time_in_min, + #CloseTimeDiffInMin: :close_time_diff_in_min, }, Article: { SenderType: :sender, @@ -516,7 +515,7 @@ module Import::OTRS Subject: :subject, InReplyTo: :in_reply_to, MessageID: :message_id, -# :ReplyTo => :reply_to, + #ReplyTo: :reply_to, References: :references, Changed: :updated_at, Created: :created_at, @@ -988,8 +987,8 @@ module Import::OTRS # lookup by roles # roles of user - # groups of roles - # queues of group + # groups of roles + # queues of group queue_ids end diff --git a/lib/notification_factory.rb b/lib/notification_factory.rb index f982b635e..8fda5a610 100644 --- a/lib/notification_factory.rb +++ b/lib/notification_factory.rb @@ -3,12 +3,12 @@ module NotificationFactory =begin result_string = NotificationFactory.build( - :string => 'Hi #{recipient.firstname},', - :objects => { - :ticket => ticket, - :recipient => User.find(2), + string: 'Hi #{recipient.firstname},', + objects: { + ticket : ticket, + recipient: User.find(2), }, - :locale => 'en', + locale: 'en', ) =end @@ -94,10 +94,10 @@ module NotificationFactory =begin success = NotificationFactory.send( - :recipient => User.find(123), - :subject => 'sime subject', - :body => 'some body', - :content_type => '', # optional, e. g. 'text/html' + recipient: User.find(123), + subject: 'sime subject', + body: 'some body', + content_type: '', # optional, e. g. 'text/html' ) =end @@ -113,7 +113,7 @@ module NotificationFactory Channel::EmailSend.send( { -# :in_reply_to => self.in_reply_to, + # in_reply_to: in_reply_to, from: sender, to: data[:recipient][:email], subject: data[:subject], diff --git a/lib/sessions.rb b/lib/sessions.rb index 1f8d3b5a4..746064d95 100644 --- a/lib/sessions.rb +++ b/lib/sessions.rb @@ -577,8 +577,6 @@ returns Rails.logger.error e.backtrace.join("\n ") sleep 10 begin -# ActiveRecord::Base.remove_connection -# ActiveRecord::Base.connection_pool.reap ActiveRecord::Base.connection_pool.release_connection rescue => e Rails.logger.error "Can't reconnect to database #{ e.inspect }" diff --git a/lib/sessions/cache_in.rb b/lib/sessions/cache_in.rb index e52251305..ace69019f 100644 --- a/lib/sessions/cache_in.rb +++ b/lib/sessions/cache_in.rb @@ -10,7 +10,6 @@ module Sessions::CacheIn end def self.set( key, value, params = {} ) -# puts 'CacheIn.set:' + key + '-' + value.inspect if params[:expires_in] @@expires_in[key] = Time.now + params[:expires_in] @@expires_in_ttl[key] = params[:expires_in] @@ -46,7 +45,6 @@ module Sessions::CacheIn end def self.get( key, params = {} ) -# puts 'CacheIn.get:' + key + '-' + @@data[ key ].inspect return if expired( key, params ) @@data[ key ] end diff --git a/lib/time_calculation.rb b/lib/time_calculation.rb index 67e0f3004..cc8d37755 100644 --- a/lib/time_calculation.rb +++ b/lib/time_calculation.rb @@ -268,7 +268,7 @@ put working hours matrix and timezone in function, returns UTC working hours mat month = start_time.month year = start_time.year hour = start_time.hour -#puts "start outer loop #{start_time}-#{week_day}-#{year}-#{month}-#{day}-#{hour}|c#{count}" + #puts "start outer loop #{start_time}-#{week_day}-#{year}-#{month}-#{day}-#{hour}|c#{count}" # check if it's vacation day if config diff --git a/vendor/lib/facebook_database.rb b/vendor/lib/facebook_database.rb index 1512d3e64..5171243f1 100644 --- a/vendor/lib/facebook_database.rb +++ b/vendor/lib/facebook_database.rb @@ -4,8 +4,7 @@ class FacebookDatabase < OmniAuth::Strategies::Facebook def initialize(app, *args, &block) # database lookup -# puts 'FacebookDatabase -> initialize' - config = Setting.get('auth_facebook_credentials') || {} + config = Setting.get('auth_facebook_credentials') || {} args[0] = config['app_id'] args[1] = config['app_secret'] super diff --git a/vendor/lib/google_oauth2_database.rb b/vendor/lib/google_oauth2_database.rb index d7046c3e8..8f0850022 100644 --- a/vendor/lib/google_oauth2_database.rb +++ b/vendor/lib/google_oauth2_database.rb @@ -4,8 +4,7 @@ class GoogleOauth2Database < OmniAuth::Strategies::GoogleOauth2 def initialize(app, *args, &block) # database lookup -# puts 'GoogleOauth2Database -> initialize' - config = Setting.get('auth_google_oauth2_credentials') || {} + config = Setting.get('auth_google_oauth2_credentials') || {} args[0] = config['client_id'] args[1] = config['client_secret'] super diff --git a/vendor/lib/linked_in_database.rb b/vendor/lib/linked_in_database.rb index e7b48fabb..55e6f4d3f 100644 --- a/vendor/lib/linked_in_database.rb +++ b/vendor/lib/linked_in_database.rb @@ -4,8 +4,7 @@ class LinkedInDatabase < OmniAuth::Strategies::LinkedIn def initialize(app, *args, &block) # database lookup -# puts 'LinkedInDatabase -> initialize' - config = Setting.get('auth_linkedin_credentials') || {} + config = Setting.get('auth_linkedin_credentials') || {} args[0] = config['app_id'] args[1] = config['app_secret'] super diff --git a/vendor/lib/twitter_database.rb b/vendor/lib/twitter_database.rb index 4ae2900e4..c6ac5971d 100644 --- a/vendor/lib/twitter_database.rb +++ b/vendor/lib/twitter_database.rb @@ -4,8 +4,7 @@ class TwitterDatabase < OmniAuth::Strategies::Twitter def initialize(app, *args, &block) # database lookup -# puts 'TwitterDatabase -> initialize' - config = Setting.get('auth_twitter_credentials') || {} + config = Setting.get('auth_twitter_credentials') || {} args[0] = config['key'] args[1] = config['secret'] super