repo.or.cz
/
metropolis.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
allow easier, single-file options for TC and TDB
[metropolis.git]
/
lib
/
metropolis
/
tc.rb
blob
1f15e7b3033143a3c90ee2d416022a4d8747424c
1
# -*- encoding: binary -*-
2
require 'tokyocabinet'
3
4
module Metropolis::TC
5
autoload :HDB, 'metropolis/tc/hdb'
6
7
def self.extended(obj)
8
obj.instance_eval do
9
case ext = File.extname(@path_pattern || @path)
10
when '.tch'
11
extend Metropolis::TC::HDB
12
else
13
raise ArgumentError, "unsupported suffix: #{ext}"
14
end
15
end
16
end
17
end