Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
rubocop time
Browse files Browse the repository at this point in the history
  • Loading branch information
Chew committed May 9, 2019
1 parent f505597 commit f5159de
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 14 deletions.
7 changes: 6 additions & 1 deletion .rubocop.yml
@@ -1,8 +1,10 @@
require: rubocop-performance

Layout/EmptyLineAfterGuardClause:
Enabled: false

Metrics/LineLength:
Max: 356
Enabled: false

Security/Eval:
Enabled: false
Expand All @@ -13,6 +15,9 @@ MethodLength:
Style/RescueStandardError:
Enabled: false

Naming/UncommunicativeMethodParamName:
Enabled: false

AllCops:
DisplayCopNames: true
TargetRubyVersion: 2.4.1
Expand Down
2 changes: 1 addition & 1 deletion lib/extensions/dbgeek.rb
Expand Up @@ -28,6 +28,6 @@ def getvotes(id)
end

def getallvotes
JSON.parse(RestClient.get("https://stats.hqtrivia.pro/api/votes", Authorization: CONFIG['sta_api'])).each {}
JSON.parse(RestClient.get('https://stats.hqtrivia.pro/api/votes', Authorization: CONFIG['sta_api'])).each {}
end
end
4 changes: 2 additions & 2 deletions lib/plugins/about.rb
Expand Up @@ -163,12 +163,12 @@ module About
data = JSON.parse(RestClient.get(CONFIG['web_loc']))

event.channel.send_embed do |embed|
embed.title = "HQ Bot Server Load Average"
embed.title = 'HQ Bot Server Load Average'

data['processes'].each do |process|
next if process['name'] != 'ruby run'

embed.add_field(name: "Bot \##{process['pm_id']}", value: ["CPU: #{process['monit']['cpu']}%", "Memory #{(process['monit']['memory'].to_f / 1000000).round(2)} MB", "Uptime: #{seconds_to_format(process['pm2_env']['created_at'])}"].join("\n"), inline: true)
embed.add_field(name: "Bot \##{process['pm_id']}", value: ["CPU: #{process['monit']['cpu']}%", "Memory #{(process['monit']['memory'].to_f / 1_000_000).round(2)} MB", "Uptime: #{seconds_to_format(process['pm2_env']['created_at'])}"].join("\n"), inline: true)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/crypto.rb
Expand Up @@ -3,7 +3,7 @@ module Crypto

command(:crypto) do |event|
if event.user.id != CONFIG['owner_id']
event.respond "Only Chew may see her coin count. Sorry!"
event.respond 'Only Chew may see her coin count. Sorry!'
break
end

Expand All @@ -13,7 +13,7 @@ module Crypto
total = 0

accounts.each do |account|
next if account['currency'] == "USD"
next if account['currency'] == 'USD'
if values[account['currency']].nil?
values[account['currency']] = Coin.new(account['currency'], account['balance']['amount'].to_f, account['native_balance']['amount'].to_f)
else
Expand Down
10 changes: 5 additions & 5 deletions lib/plugins/eval.rb
Expand Up @@ -15,12 +15,12 @@ module Eval
e.description = evaluated.to_s
e.color = '00FF00'
end
rescue StandardError, ScriptError => f
event.channel.send_embed do |e|
e.title = '**Evaluation Failed!**'
rescue StandardError, ScriptError => e
event.channel.send_embed do |embed|
embed.title = '**Evaluation Failed!**'

e.description = f.to_s
e.color = 'FF0000'
embed.description = e.to_s
embed.color = 'FF0000'
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/nextgame.rb
Expand Up @@ -30,7 +30,7 @@ module NextGame
begin
prize = "$#{(showstuff['prizeCents'] / 100).to_i.to_sc}"

prize = "#{prize}\n#{showstuff['prizePoints']/1000000}M points" unless showstuff['prizePoints'].nil? || showstuff['prizePoints'].zero?
prize = "#{prize}\n#{showstuff['prizePoints'] / 1_000_000}M points" unless showstuff['prizePoints'].nil? || showstuff['prizePoints'].zero?
rescue NoMethodError
begin
event.channel.send_embed do |embed|
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/restart.rb
Expand Up @@ -6,7 +6,7 @@ module Restart
event.respond "Sorry kiddo, you can't restart the bot!"
break
end
event.respond "Restarting the bot..."
event.respond 'Restarting the bot...'
sleep 1
exec("pm2 restart #{Bot.shard_key[0]}")
end
Expand Down
2 changes: 1 addition & 1 deletion run.rb
Expand Up @@ -6,7 +6,7 @@
require 'dblruby'
require 'rufus-scheduler'
require 'coinbase/wallet'
require "sentry-raven"
require 'sentry-raven'
puts 'All dependencies loaded'

CONFIG = YAML.load_file('config.yaml')
Expand Down

0 comments on commit f5159de

Please sign in to comment.