2005-11-07 05:25:36 -05:00
|
|
|
require 'active_support'
|
|
|
|
|
2005-11-07 08:31:19 -05:00
|
|
|
begin
|
2005-11-07 10:35:03 -05:00
|
|
|
require_library_or_gem 'fcgi'
|
2005-11-07 08:31:19 -05:00
|
|
|
rescue Exception
|
|
|
|
# FCGI not available
|
|
|
|
end
|
|
|
|
|
2005-11-07 05:25:36 -05:00
|
|
|
server = case ARGV.first
|
|
|
|
when "lighttpd"
|
|
|
|
ARGV.shift
|
|
|
|
when "webrick"
|
|
|
|
ARGV.shift
|
|
|
|
else
|
2005-11-07 08:31:19 -05:00
|
|
|
if RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI)
|
2005-11-07 05:25:36 -05:00
|
|
|
"lighttpd"
|
|
|
|
else
|
|
|
|
"webrick"
|
|
|
|
end
|
2004-11-23 20:04:44 -05:00
|
|
|
end
|
|
|
|
|
2005-11-07 05:25:36 -05:00
|
|
|
if server == "webrick"
|
|
|
|
puts "=> Booting WEBrick..."
|
|
|
|
else
|
|
|
|
puts "=> Booting lighttpd (use 'script/server webrick' to force WEBrick)"
|
|
|
|
end
|
2005-02-20 18:04:42 -05:00
|
|
|
|
2005-11-07 05:25:36 -05:00
|
|
|
require "commands/servers/#{server}"
|