aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/commands/server.rb
blob: 64e5b1fa7acd22da5952210b0d4355c696d2a614 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                                 

   




                                                                           
 
                                   
require 'active_support'

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

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

require "commands/servers/#{server}"