Skip to content

Commit

Permalink
Support linking [], []=, <<, and >> methods
Browse files Browse the repository at this point in the history
This should fix issue 191.
  • Loading branch information
jeremyevans committed Mar 22, 2013
1 parent 6d674f4 commit 4943d20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/rdoc/cross_reference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class RDoc::CrossReference
#
# See CLASS_REGEXP_STR

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

##
# Regular expressions matching text that should potentially have
Expand Down
7 changes: 4 additions & 3 deletions test/test_rdoc_cross_reference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ def refute_ref name
def test_METHOD_REGEXP_STR
re = /#{RDoc::CrossReference::METHOD_REGEXP_STR}/

re =~ '==='

assert_equal '===', $&
%w'=== [] []= << >>'.each do |x|
re =~ x
assert_equal x, $&
end
end

def test_resolve_C2
Expand Down

0 comments on commit 4943d20

Please sign in to comment.