Skip to content

Commit ebc6666

Browse files
committed
RDoc can now link #=== methods
The METHOD_REGEXP_STR was missing === so it could not be linked. Fixes #164
1 parent 6dd8d41 commit ebc6666

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

History.rdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ to build HTML documentation when installing gems.)
2626
* RDoc now ignores methods defined on constants instead of creating a fake
2727
module. Bug #163 by Zachary Scott.
2828
* Fixed ChangeLog parsing for FFI gem. Bug #165 by Zachary Scott.
29+
* RDoc now links \#=== methods. Bug #164 by Zachary Scott.
2930

3031
=== 4.0.0.preview2.1 / 2012-12-14
3132

lib/rdoc/cross_reference.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class RDoc::CrossReference
1818
#
1919
# See CLASS_REGEXP_STR
2020

21-
METHOD_REGEXP_STR = '([a-z]\w*[!?=]?|%)(?:\([\w.+*/=<>-]*\))?'
21+
METHOD_REGEXP_STR = '([a-z]\w*[!?=]?|%|===)(?:\([\w.+*/=<>-]*\))?'
2222

2323
##
2424
# Regular expressions matching text that should potentially have

test/test_rdoc_cross_reference.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ def refute_ref name
1616
assert_equal name, @xref.resolve(name, name)
1717
end
1818

19+
def test_METHOD_REGEXP_STR
20+
re = /#{RDoc::CrossReference::METHOD_REGEXP_STR}/
21+
22+
re =~ '==='
23+
24+
assert_equal '===', $&
25+
end
26+
1927
def test_resolve_C2
2028
@xref = RDoc::CrossReference.new @c2
2129

@@ -129,6 +137,13 @@ def test_resolve_method
129137
assert_ref @c2_c3_m, '::C2::C3#m(*)'
130138
end
131139

140+
def test_resolve_method_equals3
141+
m = RDoc::AnyMethod.new '', '==='
142+
@c1.add_method m
143+
144+
assert_ref m, '==='
145+
end
146+
132147
def test_resolve_page
133148
page = @store.add_file 'README.txt'
134149
page.parser = RDoc::Parser::Simple

0 commit comments

Comments
 (0)