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

ruby-changes:19545

From: drbrain <ko1@a...>
Date: Mon, 16 May 2011 08:04:55 +0900 (JST)
Subject: [ruby-changes:19545] drbrain:r31586 (trunk): * lib/rdoc.rb: Update to RDoc 3.6.1, allows OpenSSL::Digest to be

drbrain	2011-05-16 08:00:21 +0900 (Mon, 16 May 2011)

  New Revision: 31586

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

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

  Modified files:
    trunk/ChangeLog
    trunk/NEWS
    trunk/lib/rdoc/parser/c.rb
    trunk/lib/rdoc.rb
    trunk/test/rdoc/test_rdoc_parser_c.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31585)
+++ ChangeLog	(revision 31586)
@@ -1,3 +1,8 @@
+Mon May 16 08:00:05 2011  Eric Hodel  <drbrain@s...>
+
+	* 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@s...>
 
 	* lib/drb/acl.rb:  Add documentation.
Index: lib/rdoc.rb
===================================================================
--- lib/rdoc.rb	(revision 31585)
+++ lib/rdoc.rb	(revision 31586)
@@ -103,7 +103,7 @@
   ##
   # RDoc version you are using
 
-  VERSION = '3.6'
+  VERSION = '3.6.1'
 
   ##
   # Method visibilities
Index: lib/rdoc/parser/c.rb
===================================================================
--- lib/rdoc/parser/c.rb	(revision 31585)
+++ lib/rdoc/parser/c.rb	(revision 31586)
@@ -218,13 +218,22 @@
       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 @@
       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 @@
       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
Index: NEWS
===================================================================
--- NEWS	(revision 31585)
+++ NEWS	(revision 31586)
@@ -108,7 +108,7 @@
   * 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
Index: test/rdoc/test_rdoc_parser_c.rb
===================================================================
--- test/rdoc/test_rdoc_parser_c.rb	(revision 31585)
+++ test/rdoc/test_rdoc_parser_c.rb	(revision 31586)
@@ -236,29 +236,45 @@
     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
     content = <<-EOF
 /* Document-module: Foo

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

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