aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/commands/server.rb
blob: c9627439e84a74096c5860e71ea87c6c9b2d850a (plain) (tree)
1
2
3
4
5
6
7
8

                        
     
                               



                      





                        
                                                                                                   



                

   




                                                                           
 
                             





                                                                 
require 'active_support'

begin
  require_library_or_gem 'fcgi'
rescue Exception
  # FCGI not available
end

server = case ARGV.first
  when "lighttpd"
    ARGV.shift
  when "webrick"
    ARGV.shift
  else
    if RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI)
      "lighttpd"
    else
      "webrick"
    end
end

if server == "webrick"
  puts "=> Booting WEBrick..."
else
  puts "=> Booting lighttpd (use 'script/server webrick' to force WEBrick)"
end

require_library_or_gem 'rake'
load File.join(File.dirname(__FILE__), "..", "tasks", "tmp.rake")
begin
  Rake::Task['tmp:create'].execute 
rescue Errno::EEXIST => e 
end
require "commands/servers/#{server}"