allow variable bson_ext versions
This commit is contained in:
parent
924a275ea3
commit
0efd1d0237
|
@ -3,7 +3,7 @@
|
||||||
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
||||||
|
|
||||||
module Mongo
|
module Mongo
|
||||||
VERSION = "1.0.1"
|
VERSION = "1.0.2"
|
||||||
end
|
end
|
||||||
|
|
||||||
module Mongo
|
module Mongo
|
||||||
|
|
|
@ -87,7 +87,7 @@ module Mongo
|
||||||
#
|
#
|
||||||
# @core authenticate authenticate-instance_method
|
# @core authenticate authenticate-instance_method
|
||||||
def authenticate(username, password, save_auth=true)
|
def authenticate(username, password, save_auth=true)
|
||||||
doc = command(:getnonce => 1, :check_response => false)
|
doc = command({:getnonce => 1}, :check_response => false)
|
||||||
raise "error retrieving nonce: #{doc}" unless ok?(doc)
|
raise "error retrieving nonce: #{doc}" unless ok?(doc)
|
||||||
nonce = doc['nonce']
|
nonce = doc['nonce']
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ module Mongo
|
||||||
sock = old_sock
|
sock = old_sock
|
||||||
end
|
end
|
||||||
raise MongoArgumentError, "command must be given a selector" unless selector.is_a?(Hash) && !selector.empty?
|
raise MongoArgumentError, "command must be given a selector" unless selector.is_a?(Hash) && !selector.empty?
|
||||||
if selector.class.eql?(Hash) && selector.keys.length > 1 && RUBY_VERSION < '1.9'
|
if selector.keys.length > 1 && RUBY_VERSION < '1.9' && selector.class != BSON::OrderedHash
|
||||||
raise MongoArgumentError, "DB#command requires an OrderedHash when hash contains multiple keys"
|
raise MongoArgumentError, "DB#command requires an OrderedHash when hash contains multiple keys"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue