class RooOnRails::Checks::Sidekiq::Sidekiq

Constants

WORKER_PROCFILE_LINE

Public Instance Methods

call() click to toggle source
# File lib/roo_on_rails/checks/sidekiq/sidekiq.rb, line 13
def call
  unless ENV.fetch('SIDEKIQ_ENABLED', 'true').to_s =~ /\A(YES|TRUE|ON|1)\Z/i
    pass 'SIDEKIQ_ENABLED is set to false'
    return
  end
  check_for_procfile
  pass 'found valid Procfile'
end
check_for_procfile() click to toggle source
# File lib/roo_on_rails/checks/sidekiq/sidekiq.rb, line 27
def check_for_procfile
  return if File.exist?('Procfile') && File.read('Procfile').include?('worker')
  fail! "No Procfile found with a 'worker' command"
end
fix() click to toggle source
# File lib/roo_on_rails/checks/sidekiq/sidekiq.rb, line 22
def fix
  output = File.exist?('Procfile') ? "\n#{WORKER_PROCFILE_LINE}" : WORKER_PROCFILE_LINE
  File.open('Procfile', 'a') { |f| f.write(output) }
end
intro() click to toggle source
# File lib/roo_on_rails/checks/sidekiq/sidekiq.rb, line 9
def intro
  'Checking Sidekiq Setup...'
end