From ef96cf124840fc9b0770a18ba13d6638fcdaa189 Mon Sep 17 00:00:00 2001 From: zedshaw Date: Sat, 20 May 2006 02:56:30 +0000 Subject: Initial code review fixing some things, and rcov addition. git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@190 19e92222-5c0b-0410-8929-a290d50e31e9 --- bin/mongrel_rails | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'bin') diff --git a/bin/mongrel_rails b/bin/mongrel_rails index 58fd615..36392af 100644 --- a/bin/mongrel_rails +++ b/bin/mongrel_rails @@ -37,7 +37,7 @@ class Start < GemPlugin::Plugin "/commands" ['-G', '--generate CONFIG', "Generate a config file for -C", :@generate, nil] ] end - + def validate @cwd = File.expand_path(@cwd) valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd" @@ -74,22 +74,22 @@ class Start < GemPlugin::Plugin "/commands" conf = YAML.load_file(@config_file) settings = conf.merge(settings) end - + config = Mongrel::Rails::RailsConfigurator.new(settings) do log "Starting Mongrel in #{defaults[:environment]} mode at #{defaults[:host]}:#{defaults[:port]}" - + if defaults[:daemon] log "Daemonizing, any open files are closed. Look at #{defaults[:pid_file]} and #{defaults[:log_file]} for info." daemonize end - + listener do mime = {} if defaults[:mime_map] log "Loading additional MIME types from #{defaults[:mime_map]}" mime = load_mime_map(defaults[:mime_map], mime) end - + if defaults[:debug] log "Installing debugging prefixed filters. Look in log/mongrel_debug for the files." debug "/" @@ -135,7 +135,7 @@ def send_signal(signal, pid_file) rescue Errno::ESRCH puts "Process does not exist. Not running." end - + puts "Done." end @@ -145,12 +145,12 @@ class Stop < GemPlugin::Plugin "/commands" def configure options [ - ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd], - ['-f', '--force', "Force the shutdown.", :@force, false], - ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"] + ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd], + ['-f', '--force', "Force the shutdown.", :@force, false], + ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"] ] end - + def validate @cwd = File.expand_path(@cwd) valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd" @@ -161,7 +161,7 @@ class Stop < GemPlugin::Plugin "/commands" return @valid end - + def run if @force send_signal("KILL", @pid_file) @@ -178,12 +178,12 @@ class Restart < GemPlugin::Plugin "/commands" def configure options [ - ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd], - ['-s', '--soft', "Do a soft restart rather than a process exit restart", :@soft, false], - ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"] + ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd], + ['-s', '--soft', "Do a soft restart rather than a process exit restart", :@soft, false], + ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"] ] end - + def validate @cwd = File.expand_path(@cwd) valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd" @@ -209,7 +209,7 @@ GemPlugin::Manager.instance.load "mongrel" => GemPlugin::INCLUDE, "rails" => Gem if not Mongrel::Command::Registry.instance.run ARGV - exit 1 + exit 1 end -- cgit v1.2.3-24-ge0c7