From 7e7981c84f8cd3225b5e915cba2281869a08b784 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Tue, 10 Sep 2019 16:17:09 -0700 Subject: [ruby/rdoc] Treat multiple Ruby methods calling the same C method as aliases Previously, only calls to rb_define_alias were treated as aliases. This treats calls to rb_define_method with the same C function as aliases, with the first function defined being the primary method. This move the dedup code from the C parser to AnyMethod, and has AnyMethod look in its aliases to find the call_seq. Switch the deduplication code to remove lines matching one of the other aliases, instead of only keeping lines matching the current alias. The previous approach could eliminate all call_seq lines in cases where no line matched. This was necessary to pass tests when call_seq does deduplication by default. The only change to the darkfish template is to not perform unnecessary work by deduplicating twice. https://github.com/ruby/rdoc/commit/0ead78616b --- lib/rdoc/generator/template/darkfish/class.rhtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rdoc/generator/template/darkfish/class.rhtml') diff --git a/lib/rdoc/generator/template/darkfish/class.rhtml b/lib/rdoc/generator/template/darkfish/class.rhtml index 7733095086..596764ddc5 100644 --- a/lib/rdoc/generator/template/darkfish/class.rhtml +++ b/lib/rdoc/generator/template/darkfish/class.rhtml @@ -98,8 +98,8 @@ <% methods.each do |method| %>
"> - <% if method.call_seq then %> - <% method.call_seq.strip.split("\n").each_with_index do |call_seq, i| %> + <% if (call_seq = method.call_seq) then %> + <% call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
<%= h(call_seq.strip. -- cgit v1.2.3