1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rdoc.rb: Update to RDoc 3.6.1, allows OpenSSL::Digest to be

found.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2011-05-15 23:00:21 +00:00
parent 366f2c1120
commit f4b52722aa
5 changed files with 59 additions and 25 deletions

View file

@ -1,3 +1,8 @@
Mon May 16 08:00:05 2011 Eric Hodel <drbrain@segment7.net>
* lib/rdoc.rb: Update to RDoc 3.6.1, allows OpenSSL::Digest to be
found.
Mon May 16 05:49:54 2011 Eric Hodel <drbrain@segment7.net>
* lib/drb/acl.rb: Add documentation.

2
NEWS
View file

@ -108,7 +108,7 @@ with all sufficient information, see the ChangeLog file.
* support for bash/zsh completion.
* RDoc
* RDoc has been upgraded to RDoc 3.6. For full release notes see
* RDoc has been upgraded to RDoc 3.6.1. For full release notes see
http://docs.seattlerb.org/rdoc/History_txt.html
* rexml

View file

@ -103,7 +103,7 @@ module RDoc
##
# RDoc version you are using
VERSION = '3.6'
VERSION = '3.6.1'
##
# Method visibilities

View file

@ -218,13 +218,22 @@ class RDoc::Parser::C < RDoc::Parser
handle_class_module(var_name, "module", class_name, nil, in_module)
end
@content.scan(/([\w\.]+)\s* = \s*rb_define_class_under\s*
\(
\s*(\w+),
\s*"(\w+)",
\s*([\w\*\s\(\)\.\->]+)\s* # for SWIG
\s*\)/mx) do |var_name, in_module, class_name, parent|
handle_class_module(var_name, "class", class_name, parent, in_module)
@content.scan(/([\w\.]+)\s* = # var_name
\s*rb_define_class_under\s*
\(
\s* (\w+), # under
\s* "(\w+)", # class_name
\s*
(?:
([\w\*\s\(\)\.\->]+) | # parent_name
rb_path2class\("([\w:]+)"\) # path
)
\s*
\)
/mx) do |var_name, under, class_name, parent_name, path|
parent = path || parent_name
handle_class_module var_name, 'class', class_name, parent, under
end
@content.scan(/([\w\.]+)\s* = \s*rb_singleton_class\s*
@ -650,8 +659,8 @@ class RDoc::Parser::C < RDoc::Parser
enclosure = @classes[in_module] || @@enclosure_classes[in_module]
if enclosure.nil? and enclosure = @known_classes[in_module] then
type = /^rb_m/ =~ in_module ? "module" : "class"
handle_class_module in_module, type, enclosure, nil, nil
enc_type = /^rb_m/ =~ in_module ? "module" : "class"
handle_class_module in_module, enc_type, enclosure, nil, nil
enclosure = @classes[in_module]
end
@ -675,17 +684,21 @@ class RDoc::Parser::C < RDoc::Parser
end
cm = enclosure.add_class RDoc::NormalClass, class_name, parent_name
@stats.add_class cm
else
cm = enclosure.add_module RDoc::NormalModule, class_name
@stats.add_module cm
end
cm.record_location enclosure.top_level
find_class_comment cm.full_name, cm
case cm
when RDoc::NormalClass
@stats.add_class cm
when RDoc::NormalModule
@stats.add_module cm
end
@classes[var_name] = cm
@@enclosure_classes[var_name] = cm
@known_classes[var_name] = cm.full_name

View file

@ -236,17 +236,6 @@ VALUE cFoo = rb_define_class("Foo", rb_cObject);
assert_equal "this is the Foo class", klass.comment
end
def test_do_classes_singleton
content = <<-EOF
VALUE cFoo = rb_define_class("Foo", rb_cObject);
VALUE cFooS = rb_singleton_class(cFoo);
EOF
util_get_class content, 'cFooS'
assert_equal 'Foo', @parser.singleton_classes['cFooS']
end
def test_do_classes_class_under
content = <<-EOF
/* Document-class: Kernel::Foo
@ -256,9 +245,36 @@ VALUE cFoo = rb_define_class_under(rb_mKernel, "Foo", rb_cObject);
EOF
klass = util_get_class content, 'cFoo'
assert_equal 'Kernel::Foo', klass.full_name
assert_equal "this is the Foo class under Kernel", klass.comment
end
def test_do_classes_class_under_rb_path2class
content = <<-EOF
/* Document-class: Kernel::Foo
* this is Kernel::Foo < A::B
*/
VALUE cFoo = rb_define_class_under(rb_mKernel, "Foo", rb_path2class("A::B"));
EOF
klass = util_get_class content, 'cFoo'
assert_equal 'Kernel::Foo', klass.full_name
assert_equal 'A::B', klass.superclass
assert_equal 'this is Kernel::Foo < A::B', klass.comment
end
def test_do_classes_singleton
content = <<-EOF
VALUE cFoo = rb_define_class("Foo", rb_cObject);
VALUE cFooS = rb_singleton_class(cFoo);
EOF
util_get_class content, 'cFooS'
assert_equal 'Foo', @parser.singleton_classes['cFooS']
end
def test_do_classes_module
content = <<-EOF
/* Document-module: Foo