metropolis.git  about / heads / tags
key-value store for Rack
blob 840b57acce137f3017f0c92c83d6088e598f5f13 247 bytes (raw)
$ git show HEAD:lib/metropolis/tdb/single.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 
# -*- encoding: binary -*-
module Metropolis::TDB::Single
  def self.extended(obj)
    obj.instance_eval do
      @db = ::TDB.new(@uri.path, @tdb_opts)
    end
  end

  def db(key, &block)
    yield @db
  end

  def close!
    @db.close
  end
end

git clone https://yhbt.net/metropolis.git