class Popper::CLI

Public Instance Methods

__print_version() click to toggle source
# File lib/popper/cli.rb, line 56
def __print_version
  puts "Popper version:#{Popper::VERSION}"
end
init() click to toggle source
# File lib/popper/cli.rb, line 47
def init
  Popper::Init.run(options)
  rescue => e
    puts e
    puts e.backtrace
end
pop() click to toggle source
# File lib/popper/cli.rb, line 12
def pop
  if(options[:daemon])
    Popper.init_logger(options)
    Process.daemon
    open(options[:pidfile] || "/var/run/popper.pid" , 'w') {|f| f << Process.pid}
  else
    Popper.init_logger(options, true)
  end

  Popper.load_config(options)

  accounts = Popper.configure.accounts.map do |account|
    MailAccount.new(account)
  end.compact

  while true
    accounts.each(&:run)
    sleep(Popper.configure.interval)
  end

  rescue => e
    Popper.log.fatal(e)
    Popper.log.fatal(e.backtrace)
end
print() click to toggle source
print_action(config, rule) click to toggle source
print_config(config) click to toggle source