Skip to content

Commit 615e798

Browse files
committed
* object.c (rb_obj_equal): Add documentation. Patch by Vincent Batts.
[Ruby 1.9 - Bug ruby#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
1 parent 83d7aca commit 615e798

File tree

7 files changed

+58
-5
lines changed

7 files changed

+58
-5
lines changed

ChangeLog

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Thu May 12 07:54:59 2011 Eric Hodel <drbrain@segment7.net>
2+
3+
* object.c (rb_obj_equal): Add documentation. Patch by Vincent Batts.
4+
[Ruby 1.9 - Bug #4664]
5+
* lib/rexml: ditto
6+
* lib/mkmf.rb: ditto
7+
* ext/socket/lib/socket.rb: ditto
8+
19
Thu May 12 07:30:08 2011 Eric Hodel <drbrain@segment7.net>
210

311
* Various .document files: Update .document files to match files which

ext/socket/lib/socket.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ def family_addrinfo(*args)
2929
end
3030
end
3131

32-
def connect_internal(local_addrinfo)
32+
# creates a new Socket connected to the address of +local_addrinfo+.
33+
#
34+
# If no arguments are given, the address of the socket is not bound.
35+
#
36+
# If a block is given the created socket is yielded for each address.
37+
#
38+
def connect_internal(local_addrinfo) # :yields: socket
3339
sock = Socket.new(self.pfamily, self.socktype, self.protocol)
3440
begin
3541
sock.ipv6only! if self.ipv6?

lib/mkmf.rb

+15
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,10 @@ def have_struct_member(type, member, headers = nil, &b)
10131013
end
10141014
end
10151015

1016+
# Returns whether or not the static type +type+ is defined.
1017+
#
1018+
# See also +have_type+
1019+
#
10161020
def try_type(type, headers = nil, opt = "", &b)
10171021
if try_compile(<<"SRC", opt, &b)
10181022
#{cpp_include(headers)}
@@ -1066,6 +1070,10 @@ def fmt.%(x)
10661070
end
10671071
end
10681072

1073+
# Returns whether or not the Constant +const+ is defined.
1074+
#
1075+
# See also +have_const+
1076+
#
10691077
def try_const(const, headers = nil, opt = "", &b)
10701078
const, type = *const
10711079
if try_compile(<<"SRC", opt, &b)
@@ -1730,6 +1738,8 @@ def configuration(srcdir)
17301738
end
17311739
# :startdoc:
17321740

1741+
# creates a stub Makefile.
1742+
#
17331743
def dummy_makefile(srcdir)
17341744
configuration(srcdir) << <<RULES << CLEANINGS
17351745
CLEANFILES = #{$cleanfiles.join(' ')}
@@ -1742,6 +1752,11 @@ def dummy_makefile(srcdir)
17421752
RULES
17431753
end
17441754

1755+
# Processes the data contents of the "depend" file.
1756+
# Each line of this file is expected to be a file name.
1757+
#
1758+
# Returns the output of findings, in Makefile format.
1759+
#
17451760
def depend_rules(depend)
17461761
suffixes = []
17471762
depout = []

lib/rexml/quickpath.rb

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ class QuickPath
66
include Functions
77
include XMLTokens
88

9+
# A base Hash object to be used when initializing a
10+
# default empty namespaces set.
911
EMPTY_HASH = {}
1012

1113
def QuickPath::first element, path, namespaces=EMPTY_HASH

lib/rexml/xpath.rb

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ module REXML
55
# Wrapper class. Use this class to access the XPath functions.
66
class XPath
77
include Functions
8+
# A base Hash object, supposing to be used when initializing a
9+
# default empty namespaces set, but is currently unused.
10+
# TODO: either set the namespaces=EMPTY_HASH, or deprecate this.
811
EMPTY_HASH = {}
912

1013
# Finds and returns the first node that matches the supplied xpath.

lib/rexml/xpath_parser.rb

+10
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,30 @@
55
require 'rexml/parsers/xpathparser'
66

77
class Object
8+
# provides a unified +clone+ operation, for REXML::XPathParser
9+
# to use across multiple Object types
810
def dclone
911
clone
1012
end
1113
end
1214
class Symbol
15+
# provides a unified +clone+ operation, for REXML::XPathParser
16+
# to use across multiple Object types
1317
def dclone ; self ; end
1418
end
1519
class Fixnum
20+
# provides a unified +clone+ operation, for REXML::XPathParser
21+
# to use across multiple Object types
1622
def dclone ; self ; end
1723
end
1824
class Float
25+
# provides a unified +clone+ operation, for REXML::XPathParser
26+
# to use across multiple Object types
1927
def dclone ; self ; end
2028
end
2129
class Array
30+
# provides a unified +clone+ operation, for REXML::XPathParser
31+
# to use across multiple Object+ types
2232
def dclone
2333
klone = self.clone
2434
klone.clear

object.c

+13-4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ rb_obj_equal(VALUE obj1, VALUE obj2)
9797
return Qfalse;
9898
}
9999

100+
/*
101+
* Generates a <code>Fixnum</code> hash value for this object. This function must have the
102+
* property that a.eql?(b) implies a.hash <code>==</code> b.hash. The hash value is used by
103+
* class <code>Hash</code>. Any hash value that exceeds the capacity of a <code>Fixnum</code> will be
104+
* truncated before being used.
105+
*
106+
* "waffle" #=> "waffle"
107+
* "waffle".hash #=> -910576647
108+
*/
100109
VALUE
101110
rb_obj_hash(VALUE obj)
102111
{
@@ -1774,10 +1783,10 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
17741783
return RTEST(recur) ? rb_const_defined(mod, id) : rb_const_defined_at(mod, id);
17751784
}
17761785

1777-
VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
1778-
VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj);
1779-
VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj);
1780-
VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj);
1786+
VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
1787+
VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
1788+
VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
1789+
VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj); /* in class.c */
17811790

17821791
/*
17831792
* call-seq:

0 commit comments

Comments
 (0)