aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/commands/servers
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-06-28 23:41:29 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-06-28 23:41:29 +0000
commit0e146d54a7b31d571fe3b5d2e62085a432d7e52c (patch)
tree6ac5c3bcc9959c8a1c63c7b6cf789e8d2c0d0ca7 /railties/lib/commands/servers
parenta09274955422ad5da74ee7574b25b63f51abfb75 (diff)
downloadrails-0e146d54a7b31d571fe3b5d2e62085a432d7e52c.tar.gz
rails-0e146d54a7b31d571fe3b5d2e62085a432d7e52c.tar.bz2
rails-0e146d54a7b31d571fe3b5d2e62085a432d7e52c.zip
Mongrel: script/server works on Win32. Closes #5499.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/commands/servers')
-rw-r--r--railties/lib/commands/servers/mongrel.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/railties/lib/commands/servers/mongrel.rb b/railties/lib/commands/servers/mongrel.rb
index 6d42316ba2..b46923eb8f 100644
--- a/railties/lib/commands/servers/mongrel.rb
+++ b/railties/lib/commands/servers/mongrel.rb
@@ -1,6 +1,6 @@
require 'rbconfig'
-unless RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `mongrel_rails` }.blank?
+unless defined?(Mongrel)
puts "PROBLEM: Mongrel is not available on your system (or not in your path)"
exit 1
end
@@ -11,11 +11,11 @@ detach = false
ip = nil
port = nil
-ARGV.options do |opt|
+ARGV.clone.options do |opt|
opt.on("-p", "--port=port", Integer,
"Runs Rails on the specified port.",
"Default: 3000") { |p| port = p }
- opt.on("-b", "--binding=ip", String,
+ opt.on("-a", "--binding=ip", String,
"Binds Rails to the specified ip.",
"Default: 0.0.0.0") { |i| ip = i }
opt.on('-h', '--help', 'Show this message.') { puts opt; exit 0 }
@@ -37,7 +37,8 @@ trap(:INT) { exit }
tail_thread = nil
begin
- `mongrel_rails start #{detach ? "-d " : ""} -p #{port || default_port} -a #{ip || default_ip}`
+ ARGV.unshift("start")
+ load 'mongrel_rails'
ensure
unless detach
tail_thread.kill if tail_thread