module LitmusPaper

Constants

VERSION

Attributes

logger[RW]

Public Class Methods

check_service(service_name) click to toggle source
# File lib/litmus_paper.rb, line 51
def self.check_service(service_name)
  if service = services[service_name]
    service.current_health
  else
    nil
  end
end
configure(filename = nil) click to toggle source
# File lib/litmus_paper.rb, line 59
def self.configure(filename = nil)
  @config_file = if filename
    filename
  elsif ENV['LITMUS_CONFIG'] && File.exists?(ENV['LITMUS_CONFIG'])
    ENV['LITMUS_CONFIG']
  elsif File.exists?('/etc/litmus.conf')
    '/etc/litmus.conf'
  else
    raise "No litmus configuration file"
  end
  @config = LitmusPaper::ConfigurationFile.new(@config_file).evaluate
end
reload() click to toggle source
# File lib/litmus_paper.rb, line 72
def self.reload
  LitmusPaper.logger.info "Reloading configuration"
  begin
    configure(@config_file)
  rescue Exception => e
    LitmusPaper.logger.error "Problem reloading config: #{e.message}"
    LitmusPaper.logger.error e.backtrace.join("\n")
  end
end