🚨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

@@ -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