1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix problem when class name is also a method name

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
dave 2003-12-30 03:32:39 +00:00
parent 38043dde9d
commit 3ef4e98eb7
3 changed files with 25 additions and 6 deletions

View file

@ -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