Class: Stf::Demonizer
- Inherits:
-
Object
- Object
- Stf::Demonizer
- Defined in:
- lib/stf/system/demonizer.rb
Instance Method Summary collapse
-
#initialize(dante, opts = {}) ⇒ Demonizer
constructor
A new instance of Demonizer.
- #kill ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(dante, opts = {}) ⇒ Demonizer
Returns a new instance of Demonizer.
3 4 5 6 7 8 |
# File 'lib/stf/system/demonizer.rb', line 3 def initialize(dante, opts = {}) @dante = dante @pid_path = opts[:pid_path].to_s.empty? ? '/tmp/stf-client.pid' : opts[:pid_path] @log_path = opts[:log_path].to_s.empty? ? '/tmp/stf-client.log' : opts[:log_path] end |
Instance Method Details
#kill ⇒ Object
16 17 18 |
# File 'lib/stf/system/demonizer.rb', line 16 def kill @dante.execute(kill: true, pid_path: @pid_path) end |
#run ⇒ Object
10 11 12 13 14 |
# File 'lib/stf/system/demonizer.rb', line 10 def run @dante.execute(daemonize: true, pid_path: @pid_path, log_path: @log_path) {yield} end |