From 88fa90b7f039f62962cc8d11031446412b951be2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 6 Dec 2010 15:43:46 -0800 Subject: allow easier, single-file options for TC and TDB Most (other) users only need a single file, even though my primary use of this is for multiple files. --- lib/metropolis/hash.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/metropolis/hash.rb') diff --git a/lib/metropolis/hash.rb b/lib/metropolis/hash.rb index fb4d272..d5c70cb 100644 --- a/lib/metropolis/hash.rb +++ b/lib/metropolis/hash.rb @@ -8,7 +8,7 @@ module Metropolis::Hash def setup(opts) super - if @path = opts[:path] + if @path begin @db = Marshal.load(File.open(@path, "rb") { |fp| fp.read }) Hash === @db or raise ArgumentError, "#@path is not a marshaled Hash" -- cgit v1.2.3-24-ge0c7