diff options
author | Bob Klosinski <fluxin@gmail.com> | 2008-06-25 16:40:00 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-25 18:56:52 -0700 |
commit | a93ea88c0623b4f65af98c0eb55924c335bb3ac1 (patch) | |
tree | dee675ee2f0adc7c1e09f53b988dbe609bdf10be /railties/lib/commands/server.rb | |
parent | 24c7f41b4fdc411e35131f9065852a685032211f (diff) | |
download | rails-a93ea88c0623b4f65af98c0eb55924c335bb3ac1.tar.gz rails-a93ea88c0623b4f65af98c0eb55924c335bb3ac1.tar.bz2 rails-a93ea88c0623b4f65af98c0eb55924c335bb3ac1.zip |
Added Thin support to script/server. [#488 state:resolved]
Diffstat (limited to 'railties/lib/commands/server.rb')
-rw-r--r-- | railties/lib/commands/server.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb index 40ffdd1167..7306c248fb 100644 --- a/railties/lib/commands/server.rb +++ b/railties/lib/commands/server.rb @@ -13,11 +13,19 @@ 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" + when "lighttpd", "mongrel", "new_mongrel", "webrick", "thin" ARGV.shift else - if defined?(Mongrel) + if defined?(Thin) + "thin" + elsif defined?(Mongrel) "mongrel" elsif RUBY_PLATFORM !~ /(:?mswin|mingw)/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI) "lighttpd" @@ -33,6 +41,8 @@ case server 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)) } |