SBDB::Env: Env wird bei SBDB::* als Parameter 6 erwartet, nicht 5.

This commit is contained in:
Denis Knauf 2010-02-02 14:36:55 +01:00
parent 950d77bd95
commit 54ec11fd27
2 changed files with 8 additions and 8 deletions

View file

@ -60,7 +60,7 @@ module SBDB
class Unknown < DB
def self.new *p, &e
db = super *p[0...2], UNKNOWN, *p[2..-1], &e
db = super *p[0...2], UNKNOWN, *p[2..-1]
case db.bdb_object.get_type
when BTREE then Btree.new *p
when HASH then Hash.new *p

View file

@ -21,15 +21,15 @@ module SBDB
# returns the Bdb-object.
def bdb_object() @env end
# Opens a Btree in this Environment
def btree( *p, &e) Btree.new *p[0...5], self, p[5..-1], &e end
def btree( *p, &e) Btree.new *p[0...6], self, p[6..-1], &e end
# Opens a Hash in this Environment
def hash( *p, &e) Hash.new *p[0...5], self, p[5..-1], &e end
def hash( *p, &e) Hash.new *p[0...6], self, p[6..-1], &e end
# Opens a Recno in this Environment
def recno( *p, &e) Recno.new *p[0...5], self, p[5..-1], &e end
def recno( *p, &e) Recno.new *p[0...6], self, p[6..-1], &e end
# Opens a Queue in this Environment
def queue( *p, &e) Queue.new *p[0...5], self, p[5..-1], &e end
def queue( *p, &e) Queue.new *p[0...6], self, p[6..-1], &e end
# Opens a DB of unknown type in this Environment
def unknown( *p, &e) Unknown.new *p[0...5], self, p[5..-1], &e end
def unknown( *p, &e) Unknown.new *p[0...6], self, p[6..-1], &e end
def initialize dir = nil, flags = nil, mode = nil
@dbs, @env = WeakHash.new, Bdb::Env.new( 0)
@ -61,7 +61,7 @@ module SBDB
# Opens a Database.
# see SBDB::DB, SBDB::Btree, SBDB::Hash, SBDB::Recno, SBDB::Queue
def open type, *p, &e
(type || SBDB::Unkown).new *p[0...5], self, p[5..-1], &e
(type || SBDB::Unkown).new *p[0...6], self, p[6..-1], &e
end
alias db open
alias open_db open
@ -71,7 +71,7 @@ module SBDB
# If you use this, never use close. It's possible somebody else use it too.
# The Databases, which are opened, will close, if the Environment will close.
def [] file, name = nil, type = nil, &e
@dbs[ [file, name]] ||= (type || SBDB::Unkown).new file, name, nil, nil, self, &e
@dbs[ [file, name]] ||= (type || SBDB::Unkown).new file, name, nil, nil, nil, self, &e
end
end
Env = Environment