🚨Fix Rubocop lint errors

This commit is contained in:
Pranav Raj S
2019-10-20 14:17:26 +05:30
committed by GitHub
parent dd018f3682
commit 94c6d6db6f
124 changed files with 774 additions and 914 deletions

View File

@@ -7,8 +7,6 @@
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
# server 'db.example.com', user: 'deploy', roles: %w{db}
# role-based syntax
# ==================
@@ -21,8 +19,6 @@
# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
# role :db, %w{deploy@example.com}
# Configuration
# =============
# You can set any configuration variable like in config/deploy.rb
@@ -31,8 +27,6 @@
# http://capistranorb.com/documentation/getting-started/configuration/
# Feel free to add new variables to customise your setup.
# Custom SSH Options
# ==================
# You may pass any option but keep in mind that net/ssh understands a

View File

@@ -7,8 +7,6 @@
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
# server 'db.example.com', user: 'deploy', roles: %w{db}
# role-based syntax
# ==================
@@ -21,8 +19,6 @@
# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
# role :db, %w{deploy@example.com}
# Configuration
# =============
# You can set any configuration variable like in config/deploy.rb
@@ -31,8 +27,6 @@
# http://capistranorb.com/documentation/getting-started/configuration/
# Feel free to add new variables to customise your setup.
# Custom SSH Options
# ==================
# You may pass any option but keep in mind that net/ssh understands a

View File

@@ -35,7 +35,7 @@ Rails.application.configure do
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = { :host => 'localhost', port: 3000 }
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.delivery_method = :letter_opener
config.action_mailer.perform_deliveries = true

View File

@@ -46,7 +46,7 @@ Rails.application.configure do
config.log_level = :debug
# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
config.log_tags = [:request_id]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
@@ -75,7 +75,7 @@ Rails.application.configure do
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present?
if ENV['RAILS_LOG_TO_STDOUT'].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)

View File

@@ -47,7 +47,7 @@ Rails.application.configure do
config.log_level = :debug
# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
config.log_tags = [:request_id]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
@@ -56,15 +56,15 @@ Rails.application.configure do
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "chatwoot_#{Rails.env}"
config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = { :host => ENV['frontend_url'] }
config.action_mailer.default_url_options = { host: ENV['frontend_url'] }
config.action_mailer.smtp_settings = {
:address => ENV['ses_address'],
:port => 587,
:user_name => ENV["ses_username"], #Your SMTP user
:password => ENV["ses_password"], #Your SMTP password
:authentication => :login,
:enable_starttls_auto => true
}
address: ENV['ses_address'],
port: 587,
user_name: ENV['ses_username'], # Your SMTP user
password: ENV['ses_password'], # Your SMTP password
authentication: :login,
enable_starttls_auto: true
}
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
@@ -84,7 +84,7 @@ Rails.application.configure do
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present?
if ENV['RAILS_LOG_TO_STDOUT'].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)

View File

@@ -3,7 +3,7 @@
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
require "active_support/core_ext/integer/time"
require 'active_support/core_ext/integer/time'
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@@ -20,7 +20,7 @@ Rails.application.configure do
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
}
config.action_mailer.default_url_options = { :host => 'localhost', port: 3000 }
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
# Show full error reports and disable caching.
config.consider_all_requests_local = true

View File

@@ -1,2 +1,2 @@
PLAN_CONFIG = YAML::load_file(File.join(Rails.root, 'config', 'plans.yml'))
$chargebee = ChargeBee.configure(:site => ENV['CHARGEBEE_SITE'], :api_key => ENV['CHARGEBEE_API_KEY'])
PLAN_CONFIG = YAML.load_file(File.join(Rails.root, 'config', 'plans.yml'))
$chargebee = ChargeBee.configure(site: ENV['CHARGEBEE_SITE'], api_key: ENV['CHARGEBEE_API_KEY'])

View File

@@ -1,7 +1,7 @@
unless Rails.env.production?
bot_files = Dir[Rails.root.join('app', 'bot', '**', '*.rb')]
bot_reloader = ActiveSupport::FileUpdateChecker.new(bot_files) do
bot_files.each{ |file| require_dependency file }
bot_files.each { |file| require_dependency file }
end
ActiveSupport::Reloader.to_prepare do
@@ -21,20 +21,17 @@ module Facebook
def app_id
@messaging['message']['app_id']
end
end
end
end
end
class ExampleProvider < Facebook::Messenger::Configuration::Providers::Base
def valid_verify_token?(verify_token)
def valid_verify_token?(_verify_token)
ENV['fb_verify_token']
end
def app_secret_for(page_id)
def app_secret_for(_page_id)
ENV['fb_app_secret']
end

View File

@@ -10,7 +10,7 @@ if Rails.env.production?
# Optionally define an asset host for configurations that are fronted by a
# content host, such as CloudFront.
#config.asset_host = 'http://example.com'
# config.asset_host = 'http://example.com'
# The maximum period for authenticated_urls is only 7 days.
config.aws_authenticated_url_expiration = 60 * 60 * 24 * 7
@@ -22,9 +22,9 @@ if Rails.env.production?
}
config.aws_credentials = {
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
region: ENV['AWS_REGION'] # Required
region: ENV['AWS_REGION'] # Required
}
# Optional: Signing of download urls, e.g. for serving private content through

View File

@@ -1,5 +1,4 @@
Rack::Utils::HTTP_STATUS_CODES.merge!({
Rack::Utils::HTTP_STATUS_CODES.merge!(
901 => 'Trial Expired',
902 => 'Account Suspended'
})
)

View File

@@ -1,6 +1,6 @@
Pusher.app_id = ENV["pusher_app_id"]
Pusher.key = ENV["pusher_key"]
Pusher.secret = ENV["pusher_secret"]
Pusher.app_id = ENV['pusher_app_id']
Pusher.key = ENV['pusher_key']
Pusher.secret = ENV['pusher_secret']
Pusher.encrypted = true
Pusher.logger = Rails.logger
Pusher.cluster = ENV["pusher_cluster"]
Pusher.cluster = ENV['pusher_cluster']

View File

@@ -1,8 +1,6 @@
uri = URI.parse(ENV['REDIS_URL'])
redis = Rails.env.test? ? MockRedis.new : Redis.new(:url => uri)
Nightfury.redis = Redis::Namespace.new("reports", redis: redis)
redis = Rails.env.test? ? MockRedis.new : Redis.new(url: uri)
Nightfury.redis = Redis::Namespace.new('reports', redis: redis)
=begin
Alfred - Used currently for Round Robin. Add here as you use it for more features
=end
$alfred = Redis::Namespace.new("alfred", :redis => redis, :warning => true)
# Alfred - Used currently for Round Robin. Add here as you use it for more features
$alfred = Redis::Namespace.new('alfred', redis: redis, warning: true)

View File

@@ -1,6 +1,6 @@
Raven.configure do |config|
config.dsn = ENV['SENTRY_DSN']
config.environments = ['staging', 'production']
config.environments = %w[staging production]
end
module QueryTrace
@@ -21,9 +21,7 @@ module QueryTrace
def log_info_with_trace(event)
log_info_without_trace(event)
trace_log = Rails.backtrace_cleaner.clean(caller).first
if trace_log && event.payload[:name] != 'SCHEMA'
logger.debug(" \\_ \e[33mCalled from:\e[0m " + trace_log)
end
logger.debug(" \\_ \e[33mCalled from:\e[0m " + trace_log) if trace_log && event.payload[:name] != 'SCHEMA'
end
end

View File

@@ -1,10 +1,10 @@
Warden::Manager.after_set_user do |user,auth,opts|
Warden::Manager.after_set_user do |user, auth, opts|
scope = opts[:scope]
auth.cookies.signed["#{scope}.id"] = user.id
auth.cookies.signed["#{scope}.expires_at"] = 30.minutes.from_now
end
Warden::Manager.before_logout do |user, auth, opts|
Warden::Manager.before_logout do |_user, auth, opts|
scope = opts[:scope]
auth.cookies.signed["#{scope}.id"] = nil
auth.cookies.signed["#{scope}.expires_at"] = nil

View File

@@ -4,20 +4,20 @@
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
threads min_threads_count, max_threads_count
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
port ENV.fetch("PORT") { 3000 }
port ENV.fetch('PORT') { 3000 }
# Specifies the `environment` that Puma will run in.
#
environment ENV.fetch("RAILS_ENV") { "development" }
environment ENV.fetch('RAILS_ENV') { 'development' }
# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' }
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked web server processes. If using threads and workers together

View File

@@ -1,15 +1,13 @@
Rails.application.routes.draw do
#AUTH STARTS
# AUTH STARTS
match 'auth/:provider/callback', to: 'home#callback', via: [:get, :post]
mount_devise_token_auth_for 'User', at: 'auth', controllers: { confirmations: 'confirmations', passwords: 'passwords',
sessions: 'sessions' }, via: [:get, :post]
sessions: 'sessions' }, via: [:get, :post]
root to: 'dashboard#index'
root :to => "dashboard#index"
get "/app", to: "dashboard#index"
get "/app/*params", to: "dashboard#index"
get '/app', to: 'dashboard#index'
get '/app/*params', to: 'dashboard#index'
match '/status', to: 'home#status', via: [:get]
@@ -40,7 +38,7 @@ Rails.application.routes.draw do
resources :labels, only: [:index]
resources :canned_responses, except: [:show, :edit, :new]
resources :inbox_members, only: [:create, :show], param: :inbox_id
resources :facebook_indicators, only:[] do
resources :facebook_indicators, only: [] do
collection do
post :mark_seen
post :typing_on
@@ -72,7 +70,7 @@ Rails.application.routes.draw do
end
resources :conversations, only: [:index, :show] do
scope module: :conversations do #for nested controller
scope module: :conversations do # for nested controller
resources :messages, only: [:create]
resources :assignments, only: [:create]
resources :labels, only: [:create, :index]
@@ -86,7 +84,7 @@ Rails.application.routes.draw do
end
end
scope module: "mailer" do
scope module: 'mailer' do
resources :conversations, only: [:show]
end

View File

@@ -1,6 +1,6 @@
Spring.watch(
".ruby-version",
".rbenv-vars",
"tmp/restart.txt",
"tmp/caching-dev.txt"
'.ruby-version',
'.rbenv-vars',
'tmp/restart.txt',
'tmp/caching-dev.txt'
)