diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-12-04 15:56:11 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-12-04 15:56:11 -0800 |
commit | 76a68577ce61c02689ad450c054b69bf1a8d6f60 (patch) | |
tree | 0b4b3ecbc08eaba319401f4726b108c3a0a24cb4 /lib | |
parent | 91774f18ae0bb044c24d75d275ccb90b1bd80ad0 (diff) | |
download | ruby-tdb-76a68577ce61c02689ad450c054b69bf1a8d6f60.tar.gz |
TDB#clear maps to tdb_wipe_all and TDB#repack maps to TDB#repack.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tdb/mt.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/tdb/mt.rb b/lib/tdb/mt.rb index 6742cc4..7e7a09d 100644 --- a/lib/tdb/mt.rb +++ b/lib/tdb/mt.rb @@ -5,14 +5,17 @@ module TDB::MT @lock = Mutex.new end - %w( + wrap_methods = %w( close closed? fetch [] store []= insert! modify! insert modify key? has_key? include? member? nuke! delete lockall trylockall unlockall lockall_read trylockall_read unlockall_read lockall_mark lockall_unmark - ).each do |meth| + clear + ) + wrap_methods << :repack if TDB.method_defined?(:repack) + wrap_methods.each do |meth| eval "def #{meth}(*args); @lock.synchronize { super }; end" end |