summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/rdoc/code_objects.rb7
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 40a76fe553..81ae2d19f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Apr 26 21:40:09 2004 Dave Thomas <dave@pragprog.com>
+
+ * lib/rdoc/code_objects.rb (RDoc::Context::add_alias): Only alias
+ to instance methods.
+
Sun Apr 25 18:26:23 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in (ac_cv_func_fork): set to no on DJGPP.
diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb
index a60affb7de..1d2e4d2129 100644
--- a/lib/rdoc/code_objects.rb
+++ b/lib/rdoc/code_objects.rb
@@ -195,7 +195,7 @@ module RDoc
end
def add_alias(an_alias)
- meth = find_method_named(an_alias.old_name)
+ meth = find_instance_method_named(an_alias.old_name)
if meth
new_meth = AnyMethod.new(an_alias.text, an_alias.new_name)
new_meth.is_alias_for = meth
@@ -380,6 +380,11 @@ module RDoc
@method_list.find {|meth| meth.name == name}
end
+ # Find a named instance method, or return nil
+ def find_instance_method_named(name)
+ @method_list.find {|meth| meth.name == name && !meth.singleton}
+ end
+
# Find a named constant, or return nil
def find_constant_named(name)
@constants.find {|m| m.name == name}