Class: RoDaemon::Data::Daemon
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RoDaemon::Data::Daemon
- Extended by:
- Helper
- Includes:
- RoThor::Sh
- Defined in:
- lib/ro_daemon/data.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Helper
Class Method Details
.create(*args, &blk) ⇒ Object
20 21 22 23 24 |
# File 'lib/ro_daemon/data.rb', line 20 def create(*args, &blk) r = super puts "create #{self}" r end |
.new(*args, &blk) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/ro_daemon/data.rb', line 13 def new(*args, &blk) r = super r.stdout = logs_dir("#{r.id}.log") r.stderr = logs_dir("#{r.id}_err.log") r end |
Instance Method Details
#closed?(*args, &blk) ⇒ Boolean
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/ro_daemon/data.rb', line 28 def closed?(*args, &blk) begin sh "ps --pid #{pid}" true rescue ShErr => e if e.stdout.match(%r{PID TTY TIME CMD\n}) false else raise e end end end |