From f466dc6489d5a189e7cffec64bb0b23b621ab918 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Tue, 10 Oct 2017 20:59:08 +0900 Subject: [PATCH] Use `tr_s` instead of `tr` and `squeeze` --- lib/rdoc/any_method.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rdoc/any_method.rb b/lib/rdoc/any_method.rb index c5cb9c079a..5dbdf9e0ef 100644 --- a/lib/rdoc/any_method.rb +++ b/lib/rdoc/any_method.rb @@ -265,7 +265,7 @@ def param_seq params = params.sub(/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/, '\1 \2') elsif @params then params = @params.gsub(/\s*\#.*/, '') - params = params.tr("\n", " ").squeeze(" ") + params = params.tr_s("\n ", " ") params = "(#{params})" unless params[0] == ?( else params = '' @@ -276,7 +276,7 @@ def param_seq # &block params.sub!(/,?\s*&\w+/, '') - block = @block_params.tr("\n", " ").squeeze(" ") + block = @block_params.tr_s("\n ", " ") if block[0] == ?( block.sub!(/^\(/, '').sub!(/\)/, '') end