remove old DB#command arguments

This commit is contained in:
Kyle Banker 2010-08-04 16:26:29 -04:00
parent f1f0c87b3b
commit 9e223f4510
1 changed files with 5 additions and 8 deletions

View File

@ -122,7 +122,7 @@ module Mongo
} }
) )
end end
# Removes stored Javascript function from the database. Returns # Removes stored Javascript function from the database. Returns
# false if the function does not exist # false if the function does not exist
# #
@ -136,7 +136,7 @@ module Mongo
return false return false
end end
end end
# Adds a user to this database for use with authentication. If the user already # Adds a user to this database for use with authentication. If the user already
# exists in the system, the password will be updated. # exists in the system, the password will be updated.
# #
@ -390,7 +390,7 @@ module Mongo
# @param [String] to new collection name. # @param [String] to new collection name.
# #
# @return [True] returns +true+ on success. # @return [True] returns +true+ on success.
# #
# @raise MongoDBError if there's an error renaming the collection. # @raise MongoDBError if there's an error renaming the collection.
def rename_collection(from, to) def rename_collection(from, to)
oh = BSON::OrderedHash.new oh = BSON::OrderedHash.new
@ -462,9 +462,6 @@ module Mongo
# key, specifying the command to be performed. In Ruby 1.9, OrderedHash isn't necessary since # key, specifying the command to be performed. In Ruby 1.9, OrderedHash isn't necessary since
# hashes are ordered by default. # hashes are ordered by default.
# #
# @param [Boolean] admin If +true+, the command will be executed on the admin
# collection. DEPRECATED.
#
# @option opts [Boolean] :check_response (true) If +true+, raises an exception if the # @option opts [Boolean] :check_response (true) If +true+, raises an exception if the
# command fails. # command fails.
# @option opts [Socket] :sock a socket to use for sending the command. This is mainly for internal use. # @option opts [Socket] :sock a socket to use for sending the command. This is mainly for internal use.
@ -472,8 +469,8 @@ module Mongo
# @return [Hash] # @return [Hash]
# #
# @core commands command_instance-method # @core commands command_instance-method
def command(selector, opts={}, old_check_response=false, old_sock=nil) def command(selector, opts={})
check_response = opts[:check_response].nil? ? true : opts[:check_response] check_response = opts.fetch(:check_response, true)
sock = opts[:sock] sock = opts[:sock]
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.keys.length > 1 && RUBY_VERSION < '1.9' && selector.class != BSON::OrderedHash if selector.keys.length > 1 && RUBY_VERSION < '1.9' && selector.class != BSON::OrderedHash