From f7a97a0db07d728747df922cbe3a5368d27e3995 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Mon, 4 Oct 2010 12:16:11 -0400 Subject: [PATCH] Removed deprecated Connection methods --- lib/mongo/connection.rb | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/lib/mongo/connection.rb b/lib/mongo/connection.rb index f656a72..02f37dd 100644 --- a/lib/mongo/connection.rb +++ b/lib/mongo/connection.rb @@ -168,35 +168,6 @@ module Mongo end end - # @deprecated - # - # Initialize a paired connection to MongoDB. - # - # @param nodes [Array] An array of arrays, each of which specified a host and port. - # @param opts Takes the same options as Connection.new - # - # @example - # Connection.paired([["db1.example.com", 27017], - # ["db2.example.com", 27017]]) - # - # @example - # Connection.paired([["db1.example.com", 27017], - # ["db2.example.com", 27017]], - # :pool_size => 20, :timeout => 5) - # - # @return [Mongo::Connection] - def self.paired(nodes, opts={}) - warn "Connection.paired is deprecated. Please use Connection.multi instead." - unless nodes.length == 2 && nodes.all? {|n| n.is_a? Array} - raise MongoArgumentError, "Connection.paired requires that exactly two nodes be specified." - end - # Block returns an array, the first element being an array of nodes and the second an array - # of authorizations for the database. - new(nil, nil, opts) do |con| - [con.pair_val_to_connection(nodes[0]), con.pair_val_to_connection(nodes[1])] - end - end - # Initialize a connection to MongoDB using the MongoDB URI spec: # # @param uri [String] @@ -508,15 +479,6 @@ module Mongo raise ConnectionFailure, "failed to connect to any given host:port" unless connected? end - # @deprecated - # - # Create a new socket and attempt to connect to master. - # If successful, sets host and port to master and returns the socket. - def connect_to_master - warn "Connection#connect_to_master is deprecated. Use Connection#connect instead." - connect - end - def connected? @host && @port end