Method: Rack::Adapter.guess
- Defined in:
- lib/rack/adapter/loader.rb
.guess(dir) ⇒ Object
Guess which adapter to use based on the directory structure or file content. Returns a symbol representing the name of the adapter to use to load the application under dir/.
26 27 28 29 30 31 |
# File 'lib/rack/adapter/loader.rb', line 26 def self.guess(dir) ADAPTERS.each do |adapter, file| return adapter if file && ::File.exist?(::File.join(dir, file)) end raise AdapterNotFound, "No adapter found for #{dir}" end |