about summary refs log tree commit
path: root/lib/metropolis.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-11-23 18:52:08 -0800
committerEric Wong <normalperson@yhbt.net>2010-11-23 18:52:08 -0800
commit0f3c1c14630fda58363ffd7d3a942041ca2419eb (patch)
treedf1340b1702ac2d8a7b234a1c6e426445fc5d1a1 /lib/metropolis.rb
parent2bb7406db018e6902aacaf495e63d69cf9b93174 (diff)
downloadmetropolis-0f3c1c14630fda58363ffd7d3a942041ca2419eb.tar.gz
add plain Hash database support
Useful as a proof-of-concept and for benchmark base.
Diffstat (limited to 'lib/metropolis.rb')
-rw-r--r--lib/metropolis.rb4
1 files changed, 4 insertions, 0 deletions
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