diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-30 03:33:35 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-30 03:33:35 +0000 |
commit | 4ed35ce96660fc76f25181f11618d8dbb2f98931 (patch) | |
tree | 7d5eca094f1e862f60069d965a6984a33f109261 /lib/rdoc/code_objects.rb | |
parent | 72419dd811d57faa4452872194ccae431e5d44fe (diff) | |
download | ruby-4ed35ce96660fc76f25181f11618d8dbb2f98931.tar.gz ruby-4ed35ce96660fc76f25181f11618d8dbb2f98931.tar.xz ruby-4ed35ce96660fc76f25181f11618d8dbb2f98931.zip |
Fix problem when class and method names the same
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/code_objects.rb')
-rw-r--r-- | lib/rdoc/code_objects.rb | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb index bfacff132..f5b4e8185 100644 --- a/lib/rdoc/code_objects.rb +++ b/lib/rdoc/code_objects.rb @@ -320,17 +320,28 @@ module RDoc end end else - result = find_local_symbol(symbol) - if result.nil? - if symbol =~ /^[A-Z]/ - result = parent - while result && result.name != symbol - result = result.parent + # if a method is specified, then we're definitely looking for + # a module, otherwise it could be any symbol + if method + result = find_module_named(symbol) + else + result = find_local_symbol(symbol) + if result.nil? + if symbol =~ /^[A-Z]/ + result = parent + while result && result.name != symbol + result = result.parent + end end end end end if result && method + if !result.respond_to?(:find_local_symbol) + p result.name + p method + fail + end result = result.find_local_symbol(method) end result |