<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -465,7 +465,7 @@ module Mongo
       end
     end
 
-    # Send a message to the database and wait for the response.
+    # Send a message to the database and waits for the response.
     def receive_message_with_operation(operation, message, log_message=nil)
       message_with_headers = add_message_headers(operation, message).to_s
       @logger.debug(&quot;  MONGODB #{log_message || message}&quot;) if @logger
@@ -475,6 +475,61 @@ module Mongo
       end
     end
 
+    # Return +true+ if +doc+ contains an 'ok' field with the value 1.
+    def ok?(doc)
+      ok = doc['ok']
+      ok.kind_of?(Numeric) &amp;&amp; ok.to_i == 1
+    end
+
+    # DB commands need to be ordered, so selector must be an OrderedHash
+    # (or a Hash with only one element). What DB commands really need is
+    # that the &quot;command&quot; key be first.
+    def db_command(selector, use_admin_db=false)
+      if !selector.kind_of?(OrderedHash)
+        if !selector.kind_of?(Hash) || selector.keys.length &gt; 1
+          raise &quot;db_command must be given an OrderedHash when there is more than one key&quot;
+        end
+      end
+
+      cursor = Cursor.new(Collection.new(self, SYSTEM_COMMAND_COLLECTION), :admin =&gt; use_admin_db, :limit =&gt; -1, :selector =&gt; selector)
+      cursor.next_object
+    end
+    
+    # Sends a command to the database.
+    #
+    # :selector (required) :: An OrderedHash, or a standard Hash with just one
+    # key, specifying the command to be performed.
+    #
+    # :admin (optional) :: If true, the command will be executed on the admin
+    # collection.
+    #
+    # :check_response (optional) :: If true, will raise an exception if the
+    # command fails.
+    #
+    # Note: DB commands must start with the &quot;command&quot; key. For this reason,
+    # any selector containing more than one key must be an OrderedHash.
+    def command(selector, admin=false, check_response=false)
+      raise MongoArgumentError, &quot;command must be given a selector&quot; unless selector.is_a?(Hash) &amp;&amp; !selector.empty?
+      if selector.class.eql?(Hash) &amp;&amp; selector.keys.length &gt; 1 
+        raise MongoArgumentError, &quot;DB#command requires an OrderedHash when hash contains multiple keys&quot;
+      end
+
+      result = Cursor.new(system_command_collection, :admin =&gt; admin, 
+        :limit =&gt; -1, :selector =&gt; selector).next_object
+
+      if check_response &amp;&amp; !ok?(result)
+        raise OperationFailure, &quot;Database command '#{selector.keys.first}' failed.&quot;
+      else
+        result
+      end
+    end
+
+    def full_collection_name(collection_name)
+      &quot;#{@name}.#{collection_name}&quot;
+    end
+
+    private
+
     def receive
       receive_header
       number_received, cursor_id = receive_response_header
@@ -549,61 +604,6 @@ module Mongo
       message
     end
 
-    # Return +true+ if +doc+ contains an 'ok' field with the value 1.
-    def ok?(doc)
-      ok = doc['ok']
-      ok.kind_of?(Numeric) &amp;&amp; ok.to_i == 1
-    end
-
-    # DB commands need to be ordered, so selector must be an OrderedHash
-    # (or a Hash with only one element). What DB commands really need is
-    # that the &quot;command&quot; key be first.
-    def db_command(selector, use_admin_db=false)
-      if !selector.kind_of?(OrderedHash)
-        if !selector.kind_of?(Hash) || selector.keys.length &gt; 1
-          raise &quot;db_command must be given an OrderedHash when there is more than one key&quot;
-        end
-      end
-
-      cursor = Cursor.new(Collection.new(self, SYSTEM_COMMAND_COLLECTION), :admin =&gt; use_admin_db, :limit =&gt; -1, :selector =&gt; selector)
-      cursor.next_object
-    end
-    
-    # Sends a command to the database.
-    #
-    # :selector (required) :: An OrderedHash, or a standard Hash with just one
-    # key, specifying the command to be performed.
-    #
-    # :admin (optional) :: If true, the command will be executed on the admin
-    # collection.
-    #
-    # :check_response (optional) :: If true, will raise an exception if the
-    # command fails.
-    #
-    # Note: DB commands must start with the &quot;command&quot; key. For this reason,
-    # any selector containing more than one key must be an OrderedHash.
-    def command(selector, admin=false, check_response=false)
-      raise MongoArgumentError, &quot;command must be given a selector&quot; unless selector.is_a?(Hash) &amp;&amp; !selector.empty?
-      if selector.class.eql?(Hash) &amp;&amp; selector.keys.length &gt; 1 
-        raise MongoArgumentError, &quot;DB#command requires an OrderedHash when hash contains multiple keys&quot;
-      end
-
-      result = Cursor.new(system_command_collection, :admin =&gt; admin, 
-        :limit =&gt; -1, :selector =&gt; selector).next_object
-
-      if check_response &amp;&amp; !ok?(result)
-        raise OperationFailure, &quot;Database command '#{selector.keys.first}' failed.&quot;
-      else
-        result
-      end
-    end
-
-    def full_collection_name(collection_name)
-      &quot;#{@name}.#{collection_name}&quot;
-    end
-
-    private
-
     # Prepares a message for transmission to MongoDB by
     # constructing a valid message header.
     def add_message_headers(operation, message)</diff>
      <filename>lib/mongo/db.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>867783c665593b77578691ed93cf7d2ebce5c860</id>
    </parent>
  </parents>
  <author>
    <name>Kyle Banker</name>
    <email>kylebanker@gmail.com</email>
  </author>
  <url>http://github.com/mongodb/mongo-ruby-driver/commit/48b5e069e0eb3db06c339f39a8e0b4d6bb2b3294</url>
  <id>48b5e069e0eb3db06c339f39a8e0b4d6bb2b3294</id>
  <committed-date>2009-11-05T13:14:37-08:00</committed-date>
  <authored-date>2009-11-05T13:14:37-08:00</authored-date>
  <message>minor: made some db connection method private.</message>
  <tree>36603b08dd4b7fc340e86a0ddf9dc86302fbaaf2</tree>
  <committer>
    <name>Kyle Banker</name>
    <email>kylebanker@gmail.com</email>
  </committer>
</commit>
