Permalink
Browse files

Add --prefix option to script/server when using mongrel. [dacat] Closes

#9716

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7708 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 22dc11c commit f854ecd126da77f2ec10667e58315059c98f9af3 @NZKoz NZKoz committed Oct 1, 2007
Showing with 12 additions and 1 deletion.
  1. +1 −0 railties/CHANGELOG
  2. +11 −1 railties/lib/commands/process/spawner.rb
View
@@ -2,6 +2,7 @@
* Removed calls to fixtures in generated tests as fixtures :all is now present by default in test_helper.rb [DHH]
+* Add --prefix option to script/server when using mongrel. [dacat]
*2.0.0 [Preview Release]* (September 29th, 2007) [Includes duplicates of changes from 1.1.4 - 1.2.3]
@@ -65,6 +65,14 @@ def self.spawn(port)
"-c #{OPTIONS[:rails_root]} " +
"-l #{OPTIONS[:rails_root]}/log/mongrel.log"
+ # Add prefix functionality to spawner's call to mongrel_rails
+ # Digging through monrel's project subversion server, the earliest
+ # Tag that has prefix implemented in the bin/mongrel_rails file
+ # is 0.3.15 which also happens to be the earilest tag listed.
+ # References: http://mongrel.rubyforge.org/svn/tags
+ if Mongrel::Const::MONGREL_VERSION.to_f >=0.3 && !OPTIONS[:prefix].nil?
+ cmd = cmd + " --prefix #{OPTIONS[:prefix]}"
+ end
system(cmd)
end
@@ -121,7 +129,8 @@ def self.can_bind_to_custom_address?
:port => 8000,
:address => '0.0.0.0',
:instances => 3,
- :repeat => nil
+ :repeat => nil,
+ :prefix => nil
}
ARGV.options do |opts|
@@ -182,6 +191,7 @@ def self.can_bind_to_custom_address?
opts.on("-i", "--instances=number", Integer, "Number of instances (default: #{OPTIONS[:instances]})") { |v| OPTIONS[:instances] = v }
opts.on("-r", "--repeat=seconds", Integer, "Repeat spawn attempts every n seconds (default: off)") { |v| OPTIONS[:repeat] = v }
opts.on("-e", "--environment=name", String, "test|development|production (default: #{OPTIONS[:environment]})") { |v| OPTIONS[:environment] = v }
+ opts.on("-P", "--prefix=path", String, "URL prefix for Rails app. [Used only with Mongrel > v0.3.15]: (default: #{OPTIONS[:prefix]})") { |v| OPTIONS[:prefix] = v }
opts.on("-n", "--process=name", String, "default: #{OPTIONS[:process]}") { |v| OPTIONS[:process] = v }
opts.on("-s", "--spawner=path", String, "default: #{OPTIONS[:spawner]}") { |v| OPTIONS[:spawner] = v }
opts.on("-d", "--dispatcher=path", String, "default: #{OPTIONS[:dispatcher]}") { |dispatcher| OPTIONS[:dispatcher] = File.expand_path(dispatcher) }

0 comments on commit f854ecd

Please sign in to comment.