From 0f3c1c14630fda58363ffd7d3a942041ca2419eb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 23 Nov 2010 18:52:08 -0800 Subject: add plain Hash database support Useful as a proof-of-concept and for benchmark base. --- lib/metropolis.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/metropolis.rb') diff --git a/lib/metropolis.rb b/lib/metropolis.rb index 1bae3d3..a7cfc47 100644 --- a/lib/metropolis.rb +++ b/lib/metropolis.rb @@ -4,12 +4,16 @@ require 'uri' module Metropolis autoload :TC, 'metropolis/tc' + autoload :Hash, 'metropolis/hash' def self.new(opts = {}) opts = opts.dup rv = Object.new uri = opts[:uri] = URI.parse(opts[:uri]) case uri.scheme + when 'hash' + opts[:path] = uri.path if uri.path != '/' + rv.extend Metropolis::Hash when 'tc' opts[:path_pattern] = uri.path opts[:query] = Rack::Utils.parse_query(uri.query) if uri.query -- cgit v1.2.3-24-ge0c7