SBDB::Env: Env wird bei SBDB::* als Parameter 6 erwartet, nicht 5.
This commit is contained in:
parent
950d77bd95
commit
54ec11fd27
|
@ -60,7 +60,7 @@ module SBDB
|
||||||
|
|
||||||
class Unknown < DB
|
class Unknown < DB
|
||||||
def self.new *p, &e
|
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
|
case db.bdb_object.get_type
|
||||||
when BTREE then Btree.new *p
|
when BTREE then Btree.new *p
|
||||||
when HASH then Hash.new *p
|
when HASH then Hash.new *p
|
||||||
|
|
|
@ -21,15 +21,15 @@ module SBDB
|
||||||
# returns the Bdb-object.
|
# returns the Bdb-object.
|
||||||
def bdb_object() @env end
|
def bdb_object() @env end
|
||||||
# Opens a Btree in this Environment
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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
|
def initialize dir = nil, flags = nil, mode = nil
|
||||||
@dbs, @env = WeakHash.new, Bdb::Env.new( 0)
|
@dbs, @env = WeakHash.new, Bdb::Env.new( 0)
|
||||||
|
@ -61,7 +61,7 @@ module SBDB
|
||||||
# Opens a Database.
|
# Opens a Database.
|
||||||
# see SBDB::DB, SBDB::Btree, SBDB::Hash, SBDB::Recno, SBDB::Queue
|
# see SBDB::DB, SBDB::Btree, SBDB::Hash, SBDB::Recno, SBDB::Queue
|
||||||
def open type, *p, &e
|
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
|
end
|
||||||
alias db open
|
alias db open
|
||||||
alias open_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.
|
# 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.
|
# The Databases, which are opened, will close, if the Environment will close.
|
||||||
def [] file, name = nil, type = nil, &e
|
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
|
||||||
end
|
end
|
||||||
Env = Environment
|
Env = Environment
|
||||||
|
|
Loading…
Reference in a new issue