From 0efd1d02379e9f15dae31a085058ae5b88689f2a Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Mon, 24 May 2010 11:43:02 -0400 Subject: [PATCH] allow variable bson_ext versions --- lib/mongo.rb | 2 +- lib/mongo/db.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mongo.rb b/lib/mongo.rb index 85d7e50..33c7559 100644 --- a/lib/mongo.rb +++ b/lib/mongo.rb @@ -3,7 +3,7 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) module Mongo - VERSION = "1.0.1" + VERSION = "1.0.2" end module Mongo diff --git a/lib/mongo/db.rb b/lib/mongo/db.rb index 9573d0c..0cdc006 100644 --- a/lib/mongo/db.rb +++ b/lib/mongo/db.rb @@ -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