[前][次][番号順一覧][スレッド一覧]

ruby-changes:19485

From: drbrain <ko1@a...>
Date: Thu, 12 May 2011 07:56:21 +0900 (JST)
Subject: [ruby-changes:19485] Ruby:r31525 (trunk): * object.c (rb_obj_equal): Add documentation. Patch by Vincent Batts.

drbrain	2011-05-12 07:56:13 +0900 (Thu, 12 May 2011)

  New Revision: 31525

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31525

  Log:
    * object.c (rb_obj_equal):  Add documentation.  Patch by Vincent Batts.
      [Ruby 1.9 - Bug #4664]
    * lib/rexml:  ditto
    * lib/mkmf.rb:  ditto
    * ext/socket/lib/socket.rb:  ditto

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/lib/socket.rb
    trunk/lib/mkmf.rb
    trunk/lib/rexml/quickpath.rb
    trunk/lib/rexml/xpath.rb
    trunk/lib/rexml/xpath_parser.rb
    trunk/object.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31524)
+++ ChangeLog	(revision 31525)
@@ -1,3 +1,11 @@
+Thu May 12 07:54:59 2011  Eric Hodel  <drbrain@s...>
+
+	* object.c (rb_obj_equal):  Add documentation.  Patch by Vincent Batts.
+	  [Ruby 1.9 - Bug #4664]
+	* lib/rexml:  ditto
+	* lib/mkmf.rb:  ditto
+	* ext/socket/lib/socket.rb:  ditto
+
 Thu May 12 07:30:08 2011  Eric Hodel  <drbrain@s...>
 
 	* Various .document files: Update .document files to match files which
Index: object.c
===================================================================
--- object.c	(revision 31524)
+++ object.c	(revision 31525)
@@ -97,6 +97,15 @@
     return Qfalse;
 }
 
+/* 
+ * Generates a <code>Fixnum</code> hash value for this object. This function must have the
+ * property that a.eql?(b) implies a.hash <code>==</code> b.hash. The hash value is used by
+ * class <code>Hash</code>. Any hash value that exceeds the capacity of a <code>Fixnum</code> will be
+ * truncated before being used.
+ *
+ * 	"waffle"	#=> "waffle"
+ * 	"waffle".hash	#=> -910576647
+ */
 VALUE
 rb_obj_hash(VALUE obj)
 {
@@ -1774,10 +1783,10 @@
     return RTEST(recur) ? rb_const_defined(mod, id) : rb_const_defined_at(mod, id);
 }
 
-VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
-VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj);
-VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj);
-VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj);
+VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
+VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
+VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
+VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
 
 /*
  *  call-seq:
Index: lib/rexml/xpath.rb
===================================================================
--- lib/rexml/xpath.rb	(revision 31524)
+++ lib/rexml/xpath.rb	(revision 31525)
@@ -5,6 +5,9 @@
   # Wrapper class.  Use this class to access the XPath functions.
   class XPath
     include Functions
+    # A base Hash object, supposing to be used when initializing a
+    # default empty namespaces set, but is currently unused.
+    # TODO: either set the namespaces=EMPTY_HASH, or deprecate this.
     EMPTY_HASH = {}
 
     # Finds and returns the first node that matches the supplied xpath.
Index: lib/rexml/quickpath.rb
===================================================================
--- lib/rexml/quickpath.rb	(revision 31524)
+++ lib/rexml/quickpath.rb	(revision 31525)
@@ -6,6 +6,8 @@
     include Functions
     include XMLTokens
 
+    # A base Hash object to be used when initializing a
+    # default empty namespaces set.
     EMPTY_HASH = {}
 
     def QuickPath::first element, path, namespaces=EMPTY_HASH
Index: lib/rexml/xpath_parser.rb
===================================================================
--- lib/rexml/xpath_parser.rb	(revision 31524)
+++ lib/rexml/xpath_parser.rb	(revision 31525)
@@ -5,20 +5,30 @@
 require 'rexml/parsers/xpathparser'
 
 class Object
+  # provides a unified +clone+ operation, for REXML::XPathParser
+  # to use across multiple Object types
   def dclone
     clone
   end
 end
 class Symbol
+  # provides a unified +clone+ operation, for REXML::XPathParser
+  # to use across multiple Object types
   def dclone ; self ; end
 end
 class Fixnum
+  # provides a unified +clone+ operation, for REXML::XPathParser
+  # to use across multiple Object types
   def dclone ; self ; end
 end
 class Float
+  # provides a unified +clone+ operation, for REXML::XPathParser
+  # to use across multiple Object types
   def dclone ; self ; end
 end
 class Array
+  # provides a unified +clone+ operation, for REXML::XPathParser
+  # to use across multiple Object+ types
   def dclone
     klone = self.clone
     klone.clear
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 31524)
+++ lib/mkmf.rb	(revision 31525)
@@ -1013,6 +1013,10 @@
   end
 end
 
+# Returns whether or not the static type +type+ is defined.
+#
+# See also +have_type+
+#
 def try_type(type, headers = nil, opt = "", &b)
   if try_compile(<<"SRC", opt, &b)
 #{cpp_include(headers)}
@@ -1066,6 +1070,10 @@
   end
 end
 
+# Returns whether or not the Constant +const+ is defined.
+#
+# See also +have_const+
+#
 def try_const(const, headers = nil, opt = "", &b)
   const, type = *const
   if try_compile(<<"SRC", opt, &b)
@@ -1730,6 +1738,8 @@
 end
 # :startdoc:
 
+# creates a stub Makefile.
+#
 def dummy_makefile(srcdir)
   configuration(srcdir) << <<RULES << CLEANINGS
 CLEANFILES = #{$cleanfiles.join(' ')}
@@ -1742,6 +1752,11 @@
 RULES
 end
 
+# Processes the data contents of the "depend" file.
+# Each line of this file is expected to be a file name.
+# 
+# Returns the output of findings, in Makefile format.
+#
 def depend_rules(depend)
   suffixes = []
   depout = []
Index: ext/socket/lib/socket.rb
===================================================================
--- ext/socket/lib/socket.rb	(revision 31524)
+++ ext/socket/lib/socket.rb	(revision 31525)
@@ -29,7 +29,13 @@
     end
   end
 
-  def connect_internal(local_addrinfo)
+  # creates a new Socket connected to the address of +local_addrinfo+.
+  #
+  # If no arguments are given, the address of the socket is not bound.
+  #
+  # If a block is given the created socket is yielded for each address.
+  #
+  def connect_internal(local_addrinfo) # :yields: socket
     sock = Socket.new(self.pfamily, self.socktype, self.protocol)
     begin
       sock.ipv6only! if self.ipv6?

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]