Class: Status
- Inherits:
-
Object
- Object
- Status
- Includes:
- Mongrel::Command::Base
- Defined in:
- lib/mongrel_status/init.rb
Instance Method Summary collapse
Instance Method Details
#configure ⇒ Object
8 9 10 11 12 13 |
# File 'lib/mongrel_status/init.rb', line 8 def configure [ ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd], ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"] ] end |
#run ⇒ Object
26 27 28 29 30 |
# File 'lib/mongrel_status/init.rb', line 26 def run pid = open(@pid_file) {|f| f.read } puts "Mongrel status:" puts "PID: #{pid}" end |
#validate ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/mongrel_status/init.rb', line 15 def validate @cwd = File.(@cwd) valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd" @pid_file = File.join(@cwd,@pid_file) valid_exists? @pid_file, "PID file #@pid_file does not exist. Not running?" return @valid end |