From dd362a786af7f5131844652fa85a07539b4da9b8 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 15 Jul 2022 17:39:21 -0400 Subject: [ruby/rdoc] Fix call-seq for aliased method with similar names deduplicate_call_seq has a bug that skips call-seq for methods where the alias is a prefix of the method name. For example, if the alias name is "each" and the current method name is "each_line", then deduplicate_call_seq will skip all call-seq for "each_line" since it will believe that it is for the alias. https://github.com/ruby/rdoc/commit/1148988ccc --- lib/rdoc/any_method.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/rdoc/any_method.rb b/lib/rdoc/any_method.rb index 0b7dd717ab..051f946a10 100644 --- a/lib/rdoc/any_method.rb +++ b/lib/rdoc/any_method.rb @@ -350,12 +350,12 @@ class RDoc::AnyMethod < RDoc::MethodAttr ignore << is_alias_for.name ignore.concat is_alias_for.aliases.map(&:name) end - ignore.map! { |n| n =~ /\A\[/ ? n[0, 1] : n} + ignore.map! { |n| n =~ /\A\[/ ? /\[.*\]/ : n} ignore.delete(method_name) ignore = Regexp.union(ignore) matching = entries.reject do |entry| - entry =~ /^\w*\.?#{ignore}/ or + entry =~ /^\w*\.?#{ignore}[$\(\s]/ or entry =~ /\s#{ignore}\s/ end -- cgit v1.2.3