Class: Dctl::Command::StatusCommand
Instance Method Summary
collapse
#initialize
#initialize
Instance Method Details
#description ⇒ Object
102
103
104
|
# File 'lib/dctl/command.rb', line 102
def description
"Get the state of specified applications (one or more)."
end
|
#execute(cmd_parser, args) ⇒ Object
106
107
108
109
110
111
112
|
# File 'lib/dctl/command.rb', line 106
def execute(cmd_parser, args)
if args.length > 0
args.each { |cmd| puts status(cmd) rescue puts $! }
else
Dir[File.join($DIR, '*.pid')].collect { |p| File.basename(p, '.*')}.each { |cmd| puts status(cmd) } end
end
|
#status(cmd) ⇒ Object
114
115
116
|
# File 'lib/dctl/command.rb', line 114
def status(cmd)
"#{cmd}: #{File.basename(Dctl::Daemon.new(cmd, $DIR, false).status.id2name)}"
end
|