module RuboCop::Daemon

Constants

TIMEOUT
VERSION

Public Class Methods

running?() click to toggle source
# File lib/rubocop/daemon.rb, line 17
def self.running?
  Cache.dir.exist? && Cache.pid_path.file? && Cache.pid_running?
end
wait_for_running_status!(expected) click to toggle source
# File lib/rubocop/daemon.rb, line 21
def self.wait_for_running_status!(expected)
  start_time = Time.now
  while Daemon.running? != expected
    sleep 0.1
    next unless Time.now - start_time > TIMEOUT

    warn "running? was not #{expected} after #{TIMEOUT} seconds!"
    exit 1
  end
end