summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-11 22:56:13 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-11 22:56:13 +0000
commit615e7987ca619a9d8df01844b61d95796b95fd19 (patch)
tree75467706dc185b58087aafb9f029e5c2e9a31ba8
parent83d7aca7f6c02a92d49be1490e72b50fe9643598 (diff)
* 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--ext/socket/lib/socket.rb8
-rw-r--r--lib/mkmf.rb15
-rw-r--r--lib/rexml/quickpath.rb2
-rw-r--r--lib/rexml/xpath.rb3
-rw-r--r--lib/rexml/xpath_parser.rb10
-rw-r--r--object.c17
7 files changed, 58 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 732b936..0e7847e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Thu May 12 07:54:59 2011 Eric Hodel <drbrain@segment7.net>
+
+ * 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@segment7.net>
* Various .document files: Update .document files to match files which
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index d7bd760..8898b51 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -29,7 +29,13 @@ class Addrinfo
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?
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 260875f..2d1fbf0 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1013,6 +1013,10 @@ SRC
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 @@ def find_type(type, opt, *headers, &b)
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 @@ preload = #{defined?($preload) && $preload ? $preload.join(' ') : ''}
end
# :startdoc:
+# creates a stub Makefile.
+#
def dummy_makefile(srcdir)
configuration(srcdir) << <<RULES << CLEANINGS
CLEANFILES = #{$cleanfiles.join(' ')}
@@ -1742,6 +1752,11 @@ all install static install-so install-rb: Makefile
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 = []
diff --git a/lib/rexml/quickpath.rb b/lib/rexml/quickpath.rb
index 06cb4f9..8229bac 100644
--- a/lib/rexml/quickpath.rb
+++ b/lib/rexml/quickpath.rb
@@ -6,6 +6,8 @@ module REXML
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
diff --git a/lib/rexml/xpath.rb b/lib/rexml/xpath.rb
index 5f7ecef..a8952ff 100644
--- a/lib/rexml/xpath.rb
+++ b/lib/rexml/xpath.rb
@@ -5,6 +5,9 @@ module REXML
# 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.
diff --git a/lib/rexml/xpath_parser.rb b/lib/rexml/xpath_parser.rb
index 3bffd38..0fc9da2 100644
--- a/lib/rexml/xpath_parser.rb
+++ b/lib/rexml/xpath_parser.rb
@@ -5,20 +5,30 @@ require 'rexml/syncenumerator'
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
diff --git a/object.c b/object.c
index fad726c..f4a28fd 100644
--- a/object.c
+++ b/object.c
@@ -97,6 +97,15 @@ rb_obj_equal(VALUE obj1, VALUE obj2)
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 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
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: