From 73171445775a4f4256feab900c8f5f03b8f82e7e Mon Sep 17 00:00:00 2001 From: Chris Cherry Date: Thu, 2 Oct 2008 01:30:34 -0700 Subject: [PATCH] Add --prefix option to script/server with Mongrel --- railties/lib/commands/servers/mongrel.rb | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/railties/lib/commands/servers/mongrel.rb b/railties/lib/commands/servers/mongrel.rb index 7bb110f..92d82b1 100644 --- a/railties/lib/commands/servers/mongrel.rb +++ b/railties/lib/commands/servers/mongrel.rb @@ -13,12 +13,14 @@ OPTIONS = { :ip => "0.0.0.0", :environment => (ENV['RAILS_ENV'] || "development").dup, :detach => false, - :debugger => false + :debugger => false, + :prefix => nil } ARGV.clone.options do |opts| opts.on("-p", "--port=port", Integer, "Runs Rails on the specified port.", "Default: 3000") { |v| OPTIONS[:port] = v } opts.on("-b", "--binding=ip", String, "Binds Rails to the specified ip.", "Default: 0.0.0.0") { |v| OPTIONS[:ip] = v } + opts.on("-P", "--prefix=path", String, "Runs Rails app with a URL prefix (path).", "Default: none") { |v| OPTIONS[:prefix] = v } opts.on("-d", "--daemon", "Make server run as a Daemon.") { OPTIONS[:detach] = true } opts.on("-u", "--debugger", "Enable ruby-debugging for the server.") { OPTIONS[:debugger] = true } opts.on("-e", "--environment=name", String, @@ -41,6 +43,7 @@ parameters = [ "-e", OPTIONS[:environment], "-P", "#{RAILS_ROOT}/tmp/pids/mongrel.pid" ] +parameters << "--prefix=#{OPTIONS[:prefix]}" unless OPTIONS[:prefix].blank? if OPTIONS[:detach] `mongrel_rails #{parameters.join(" ")} -d` -- 1.5.6.4