mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix problem when class and method names the same
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e9b667daef
commit
5b76f13a89
2 changed files with 24 additions and 6 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Tue Dec 30 12:30:30 2003 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
|
* lib/rdoc/code_objects.rb (RDoc::Context::find_symbol): If a
|
||||||
|
class and a method have the same name, finding Xxx.abc was trying
|
||||||
|
to find 'abc' in method 'Xxx', not class 'Xxx'.
|
||||||
|
|
||||||
|
|
||||||
Tue Dec 30 08:32:32 2003 Dave Thomas <dave@pragprog.com>
|
Tue Dec 30 08:32:32 2003 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
|
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
|
||||||
|
|
|
@ -319,6 +319,11 @@ module RDoc
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
# 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
|
else
|
||||||
result = find_local_symbol(symbol)
|
result = find_local_symbol(symbol)
|
||||||
if result.nil?
|
if result.nil?
|
||||||
|
@ -330,7 +335,13 @@ module RDoc
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if result && method
|
if result && method
|
||||||
|
if !result.respond_to?(:find_local_symbol)
|
||||||
|
p result.name
|
||||||
|
p method
|
||||||
|
fail
|
||||||
|
end
|
||||||
result = result.find_local_symbol(method)
|
result = result.find_local_symbol(method)
|
||||||
end
|
end
|
||||||
result
|
result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue