allow variable bson_ext versions

This commit is contained in:
Kyle Banker 2010-05-24 11:43:02 -04:00
parent 924a275ea3
commit 0efd1d0237
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
module Mongo
VERSION = "1.0.1"
VERSION = "1.0.2"
end
module Mongo

View File

@ -87,7 +87,7 @@ module Mongo
#
# @core authenticate authenticate-instance_method
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)
nonce = doc['nonce']
@ -465,7 +465,7 @@ module Mongo
sock = old_sock
end
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"
end