Skip to content
This repository
Browse code

RDoc can now link #=== methods

The METHOD_REGEXP_STR was missing === so it could not be linked.

Fixes #164
  • Loading branch information...
commit ebc66662d1f98eecc694c1fd39ac5446198bff34 1 parent 6dd8d41
Eric Hodel authored January 03, 2013
1  History.rdoc
Source Rendered
@@ -26,6 +26,7 @@ to build HTML documentation when installing gems.)
26 26
   * RDoc now ignores methods defined on constants instead of creating a fake
27 27
     module.  Bug #163 by Zachary Scott.
28 28
   * Fixed ChangeLog parsing for FFI gem.  Bug #165 by Zachary Scott.
  29
+  * RDoc now links \#=== methods.  Bug #164 by Zachary Scott.
29 30
 
30 31
 === 4.0.0.preview2.1 / 2012-12-14
31 32
 
2  lib/rdoc/cross_reference.rb
@@ -18,7 +18,7 @@ class RDoc::CrossReference
18 18
   #
19 19
   # See CLASS_REGEXP_STR
20 20
 
21  
-  METHOD_REGEXP_STR = '([a-z]\w*[!?=]?|%)(?:\([\w.+*/=<>-]*\))?'
  21
+  METHOD_REGEXP_STR = '([a-z]\w*[!?=]?|%|===)(?:\([\w.+*/=<>-]*\))?'
22 22
 
23 23
   ##
24 24
   # Regular expressions matching text that should potentially have
15  test/test_rdoc_cross_reference.rb
@@ -16,6 +16,14 @@ def refute_ref name
16 16
     assert_equal name, @xref.resolve(name, name)
17 17
   end
18 18
 
  19
+  def test_METHOD_REGEXP_STR
  20
+    re = /#{RDoc::CrossReference::METHOD_REGEXP_STR}/
  21
+
  22
+    re =~ '==='
  23
+
  24
+    assert_equal '===', $&
  25
+  end
  26
+
19 27
   def test_resolve_C2
20 28
     @xref = RDoc::CrossReference.new @c2
21 29
 
@@ -129,6 +137,13 @@ def test_resolve_method
129 137
     assert_ref @c2_c3_m, '::C2::C3#m(*)'
130 138
   end
131 139
 
  140
+  def test_resolve_method_equals3
  141
+    m = RDoc::AnyMethod.new '', '==='
  142
+    @c1.add_method m
  143
+
  144
+    assert_ref m, '==='
  145
+  end
  146
+
132 147
   def test_resolve_page
133 148
     page = @store.add_file 'README.txt'
134 149
     page.parser = RDoc::Parser::Simple

0 notes on commit ebc6666

Please sign in to comment.
Something went wrong with that request. Please try again.