diff options
Diffstat (limited to 'bin/mongrel_rails')
-rw-r--r-- | bin/mongrel_rails | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/mongrel_rails b/bin/mongrel_rails index 2066f6e..2f95230 100644 --- a/bin/mongrel_rails +++ b/bin/mongrel_rails @@ -24,7 +24,8 @@ class Start < GemPlugin::Plugin "/commands" ['-r', '--root PATH', "Set the document root (default 'public')", :@docroot, "public"], ['-B', '--debug', "Enable debugging mode", :@debug, false], ['-C', '--config PATH', "Use a config file", :@config_file, nil], - ['-S', '--script PATH', "Load the given file as an extra config script.", :@config_script, nil] + ['-S', '--script PATH', "Load the given file as an extra config script.", :@config_script, nil], + ['-G', '--generate CONFIG', "Generate a config file for -C", :@generate, nil] ] end @@ -40,6 +41,7 @@ class Start < GemPlugin::Plugin "/commands" valid_dir? @docroot, "Path to docroot not valid: #@docroot" valid_exists? @mime_map, "MIME mapping file does not exist: #@mime_map" if @mime_map valid_exists? @config_file, "Config file not there: #@config_file" if @config_file + valid_dir? File.dirname(@generate), "Problem accessing directory to #@generate" if @generate return @valid end @@ -53,6 +55,11 @@ class Start < GemPlugin::Plugin "/commands" :num_processors => @num_procs, :timeout => @timeout } + if @generate + STDERR.puts "** Writing config to #@generate" + open(@generate, "w") {|f| f.write(settings.to_yaml) } + end + if @config_file STDERR.puts "** Loading settings from #{@config_file} (command line options override)." conf = YAML.load_file(@config_file) |