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'
12 autoload :MultiHash, 'metropolis/multi_hash'
14 def self.new(opts = {})
17 uri = URI.parse(opts[:uri])
20 @query = @uri.query ? Rack::Utils.parse_query(@uri.query) : nil
21 @path_pattern = opts[:path_pattern]
22 @path = @uri.path if @uri.path != '/'
23 @multi_hash = opts[:multi_hash]
26 base = case uri.scheme
27 when 'hash' then Metropolis::Hash
28 when 'tdb' then Metropolis::TDB
29 when 'tc' then Metropolis::TC
31 raise ArgumentError, "unsupported URI scheme: #{uri.scheme}"
39 require 'metropolis/common'