Class: Minus5::Daemon::Runner
- Inherits:
-
Object
- Object
- Minus5::Daemon::Runner
- Defined in:
- lib/minus5_daemon/runner.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(klass) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(klass) ⇒ Runner
Returns a new instance of Runner.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/minus5_daemon/runner.rb', line 13 def initialize(klass) @klass = klass init_logger @config_file_set = false @options = Hashie::Mash.new( :daemonize => true, :config_file => 'config.yml', :environment => 'production', :app_name => start_script_name, :app_root => app_root) load_config load_environment_file end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
28 29 30 |
# File 'lib/minus5_daemon/runner.rb', line 28 def logger @logger end |
Instance Method Details
#run ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/minus5_daemon/runner.rb', line 30 def run mkdirs Daemons.run_proc(@options.app_name, ) do logger.info "starting daemon pid: #{Process.pid}" logger.debug "options: #{@options}" service = @klass.new(@options, @logger) service.run end end |