Sha256: 5a786ec0fa22a88114b1bf195c2ae337bd79d8b7995ad710c466a865b19f6913

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

require 'active_support'
require 'fileutils'

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

begin
  require_library_or_gem 'mongrel'
rescue Exception
  # Mongrel not available
end

begin
  require_library_or_gem 'thin'
rescue Exception
  # Thin not available
end

server = case ARGV.first
  when "lighttpd", "mongrel", "new_mongrel", "webrick", "thin"
    ARGV.shift
  else
    if defined?(Mongrel)
      "mongrel"
    elsif defined?(Thin)
      "thin"
    elsif RUBY_PLATFORM !~ /(:?mswin|mingw)/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI)
      "lighttpd"
    else
      "webrick"
    end
end

case server
  when "webrick"
    puts "=> Booting WEBrick..."
  when "lighttpd"
    puts "=> Booting lighttpd (use 'script/server webrick' to force WEBrick)"
  when "mongrel", "new_mongrel"
    puts "=> Booting Mongrel (use 'script/server webrick' to force WEBrick)"
  when "thin"
    puts "=> Booting Thin (use 'script/server webrick' to force WEBrick)"
end

%w(cache pids sessions sockets).each { |dir_to_make| FileUtils.mkdir_p(File.join(RAILS_ROOT, 'tmp', dir_to_make)) }
require "commands/servers/#{server}"

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/railties/lib/commands/server.rb
rails-2.2.3 lib/commands/server.rb
rails-2.2.2 lib/commands/server.rb