diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-27 11:17:05 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-27 11:17:05 +0000 |
commit | e2d4ebdea4eab41c4af1c5530a9e180d11529dec (patch) | |
tree | a7c3879aff825061e7915ff9c901623d78b5255d /railties/lib/commands | |
parent | f013e047ef74cdda202fbaf131be9f8e914505b1 (diff) | |
download | rails-e2d4ebdea4eab41c4af1c5530a9e180d11529dec.tar.gz rails-e2d4ebdea4eab41c4af1c5530a9e180d11529dec.tar.bz2 rails-e2d4ebdea4eab41c4af1c5530a9e180d11529dec.zip |
Introduce native mongrel handler and push mutex into dispatcher.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8488 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/commands')
-rw-r--r-- | railties/lib/commands/server.rb | 8 | ||||
-rw-r--r-- | railties/lib/commands/servers/new_mongrel.rb | 16 |
2 files changed, 22 insertions, 2 deletions
diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb index f84db9c049..5414ab3e6a 100644 --- a/railties/lib/commands/server.rb +++ b/railties/lib/commands/server.rb @@ -18,7 +18,11 @@ server = case ARGV.first ARGV.shift else if defined?(Mongrel) - "mongrel" + if Mongrel.respond_to?(:log) + "new_mongrel" + else + "mongrel" + end elsif RUBY_PLATFORM !~ /(:?mswin|mingw)/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI) "lighttpd" else @@ -31,7 +35,7 @@ case server puts "=> Booting WEBrick..." when "lighttpd" puts "=> Booting lighttpd (use 'script/server webrick' to force WEBrick)" - when "mongrel" + when "mongrel", "new_mongrel" puts "=> Booting Mongrel (use 'script/server webrick' to force WEBrick)" end diff --git a/railties/lib/commands/servers/new_mongrel.rb b/railties/lib/commands/servers/new_mongrel.rb new file mode 100644 index 0000000000..174dbf8a37 --- /dev/null +++ b/railties/lib/commands/servers/new_mongrel.rb @@ -0,0 +1,16 @@ +unless defined?(Mongrel) + abort "PROBLEM: Mongrel is not available on your system (or not in your path)" +end + +require 'rails/mongrel_server/commands' + +GemPlugin::Manager.instance.load "rails::mongrel" => GemPlugin::INCLUDE, "rails" => GemPlugin::EXCLUDE + +case ARGV[0] ||= 'start' +when 'start', 'stop', 'restart' + ARGV[0] = "rails::mongrelserver::#{ARGV[0]}" +end + +if not Mongrel::Command::Registry.instance.run ARGV + exit 1 +end |