summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-30 03:32:39 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-30 03:32:39 +0000
commitb0af12141897aa86d8b6e7d3ec302213ceea946b (patch)
tree9d1d6366c9c007027fbf3f6b6b94a3e3a3ce14c9
parentd18d86433d0eaf5877098b209d2138fa13efc032 (diff)
downloadruby-b0af12141897aa86d8b6e7d3ec302213ceea946b.tar.gz
ruby-b0af12141897aa86d8b6e7d3ec302213ceea946b.tar.xz
ruby-b0af12141897aa86d8b6e7d3ec302213ceea946b.zip
Fix problem when class name is also a method name
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@5348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--lib/rdoc/code_objects.rb23
-rw-r--r--lib/rdoc/generators/template/chm/chm.rb1
3 files changed, 25 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index cdad35ab7..3b02b3534 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
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
diff --git a/lib/rdoc/generators/template/chm/chm.rb b/lib/rdoc/generators/template/chm/chm.rb
index 6df83a777..4a89c2652 100644
--- a/lib/rdoc/generators/template/chm/chm.rb
+++ b/lib/rdoc/generators/template/chm/chm.rb
@@ -7,6 +7,7 @@ require "rdoc/generators/template/html/html"
# tag, so...
BODY.sub!(/<\?xml.*\?>/, '')
+SRC_PAGE.sub!(/<\?xml.*\?>/, '')
HPP_FILE = %{
[OPTIONS]