1 # -*- encoding: binary -*-
6 autoload :InputWrapper, 'metropolis/input_wrapper'
7 autoload :Deflate, 'metropolis/deflate'
8 autoload :Gzip, 'metropolis/gzip'
9 autoload :TC, 'metropolis/tc'
10 autoload :Hash, 'metropolis/hash'
11 autoload :TDB, 'metropolis/tdb'
13 def self.new(opts = {})
16 uri = URI.parse(opts[:uri])
19 @query = @uri.query ? Rack::Utils.parse_query(@uri.query) : nil
20 @path_pattern = opts[:path_pattern]
21 @path = @uri.path if @uri.path != '/'
24 base = case uri.scheme
25 when 'hash' then Metropolis::Hash
26 when 'tdb' then Metropolis::TDB
27 when 'tc' then Metropolis::TC
29 raise ArgumentError, "unsupported URI scheme: #{uri.scheme}"
37 require 'metropolis/common'