diff options
author | Peter Zhu <peter@peterzhu.ca> | 2022-07-15 17:39:21 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-07-18 22:36:57 +0900 |
commit | dd362a786af7f5131844652fa85a07539b4da9b8 (patch) | |
tree | 4308d2b66136c45bf6d98346f6cd10972d6bb858 /lib/rdoc | |
parent | a74634de106df63fb39a7077561657bb61a0bc97 (diff) | |
download | ruby-dd362a786af7f5131844652fa85a07539b4da9b8.tar.gz |
[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
Diffstat (limited to 'lib/rdoc')
-rw-r--r-- | lib/rdoc/any_method.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |