Class: Crono::CLI
- Inherits:
-
Object
- Object
- Crono::CLI
- Includes:
- Logging, Singleton
- Defined in:
- lib/crono/cli.rb
Overview
Crono::CLI - The main class for the crono daemon exacutable ‘bin/crono`
Constant Summary collapse
- COMMANDS =
%w(start stop restart run zap reload status)
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Methods included from Logging
Constructor Details
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
14 15 16 |
# File 'lib/crono/cli.rb', line 14 def config @config end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/crono/cli.rb', line 21 def run (ARGV) parse_command(ARGV) setup_log write_pid unless config.daemonize load_rails Cronotab.process(File.(config.cronotab)) unless have_jobs? logger.error "You have no jobs in you cronotab file #{config.cronotab}" return end if config.daemonize start_working_loop_in_daemon else start_working_loop end end |