Created
July 9, 2012 12:59
-
-
Save lloeki/3076431 to your computer and use it in GitHub Desktop.
Monkeypatching Rails 2.3.14 to boot Thin by default
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ...8<... | |
Rails.boot! | |
# default to Thin | |
if $0 == "script/server" | |
# commands/server.rb (#45) is not cooperative, so we patch Rack itself | |
require 'rack' | |
module Rack::Handler | |
puts "Patching Rack for Thin as default" | |
class << self | |
alias_method :get_without_thin_as_default, :get | |
end | |
def self.get(server) | |
self.get_without_thin_as_default(server) or self.get_without_thin_as_default("thin") | |
end | |
end unless Rack::Handler.respond_to? :get_without_thin_as_default | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment