aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-15 23:00:21 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-15 23:00:21 +0000
commitf4b52722aad5a8d2e9fc858d2f1c4147ab584d21 (patch)
tree6a9328c2147f991364e2e1d99abdad5c47da736f
parent366f2c1120653be5e08f1cc7452d3dbbe1b85f2b (diff)
downloadruby-f4b52722aad5a8d2e9fc858d2f1c4147ab584d21.tar.gz
* 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
-rw-r--r--ChangeLog5
-rw-r--r--NEWS2
-rw-r--r--lib/rdoc.rb2
-rw-r--r--lib/rdoc/parser/c.rb37
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb36
5 files changed, 58 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 59fb6ec481..4a34b0f289 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/NEWS b/NEWS
index c3cad45a5c..aaf4183a09 100644
--- a/NEWS
+++ b/NEWS
@@ -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
diff --git a/lib/rdoc.rb b/lib/rdoc.rb
index 6414bd7683..aee6da5049 100644
--- a/lib/rdoc.rb
+++ b/lib/rdoc.rb
@@ -103,7 +103,7 @@ module RDoc
##
# RDoc version you are using
- VERSION = '3.6'
+ VERSION = '3.6.1'
##
# Method visibilities
diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb
index 0f2196b2e8..12efb407a2 100644
--- a/lib/rdoc/parser/c.rb
+++ b/lib/rdoc/parser/c.rb
@@ -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
diff --git a/test/rdoc/test_rdoc_parser_c.rb b/test/rdoc/test_rdoc_parser_c.rb
index 9649933fd0..45d0b1e341 100644
--- a/test/rdoc/test_rdoc_parser_c.rb
+++ b/test/rdoc/test_rdoc_parser_c.rb
@@ -236,27 +236,43 @@ VALUE cFoo = rb_define_class("Foo", rb_cObject);
assert_equal "this is the Foo class", klass.comment
end
- def test_do_classes_singleton
+ def test_do_classes_class_under
content = <<-EOF
-VALUE cFoo = rb_define_class("Foo", rb_cObject);
-VALUE cFooS = rb_singleton_class(cFoo);
+/* Document-class: Kernel::Foo
+ * this is the Foo class under Kernel
+ */
+VALUE cFoo = rb_define_class_under(rb_mKernel, "Foo", rb_cObject);
EOF
- util_get_class content, 'cFooS'
-
- assert_equal 'Foo', @parser.singleton_classes['cFooS']
+ 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
+ def test_do_classes_class_under_rb_path2class
content = <<-EOF
/* Document-class: Kernel::Foo
- * this is the Foo class under Kernel
+ * this is Kernel::Foo < A::B
*/
-VALUE cFoo = rb_define_class_under(rb_mKernel, "Foo", rb_cObject);
+VALUE cFoo = rb_define_class_under(rb_mKernel, "Foo", rb_path2class("A::B"));
EOF
klass = util_get_class content, 'cFoo'
- assert_equal "this is the Foo class under Kernel", klass.comment
+
+ 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