# File lib/rack/adapter/loader.rb, line 29
    def self.for(name, options={})
      case name.to_sym
      when :rails
        return Rails.new(options.merge(:root => options[:chdir]))
      
      when :ramaze
        require "#{options[:chdir]}/start"

        Ramaze.trait[:essentials].delete Ramaze::Adapter
        Ramaze.start :force => true

        return Ramaze::Adapter::Base

      when :merb
        require 'merb-core'

        Merb::Config.setup(:merb_root   => options[:chdir],
                           :environment => options[:environment])
        Merb.environment = Merb::Config[:environment]
        Merb.root = Merb::Config[:merb_root]
        Merb::BootLoader.run

        return Merb::Rack::Application.new
      
      when :halcyon
        require 'halcyon'
        
        $:.unshift(Halcyon.root/'lib')
        Halcyon::Runner.load_config Halcyon.root/'config'/'config.yml'
        
        return Halcyon::Runner.new
      
      when :mack
        ENV["MACK_ENV"] = options[:environment]
        load(::File.join(options[:chdir], "Rakefile"))
        require 'mack'
        return Mack::Utils::Server.build_app
      when :file
        return Rack::File.new(options[:chdir])
      
      else
        raise AdapterNotFound, "Adapter not found: #{name}"
        
      end
    end