From 74a1543645dd9b5f3ca59456f90cb4c5f7840a41 Mon Sep 17 00:00:00 2001 From: drbrain Date: Sun, 9 Mar 2008 04:52:53 +0000 Subject: Restore missing line to RDoc::Generator#params. Patch by Lincoln Stoll. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/generator.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/rdoc') diff --git a/lib/rdoc/generator.rb b/lib/rdoc/generator.rb index 9859a3244f..322b25bf71 100644 --- a/lib/rdoc/generator.rb +++ b/lib/rdoc/generator.rb @@ -921,26 +921,27 @@ module RDoc::Generator def params # params coming from a call-seq in 'C' will start with the # method name - if p !~ /^\w/ - p = @context.params.gsub(/\s*\#.*/, '') - p = p.tr("\n", " ").squeeze(" ") - p = "(" + p + ")" unless p[0] == ?( + params = @context.params + if params !~ /^\w/ + params = @context.params.gsub(/\s*\#.*/, '') + params = params.tr("\n", " ").squeeze(" ") + params = "(" + params + ")" unless params[0] == ?( if (block = @context.block_params) # If this method has explicit block parameters, remove any # explicit &block - p.sub!(/,?\s*&\w+/, '') + params.sub!(/,?\s*&\w+/, '') block.gsub!(/\s*\#.*/, '') block = block.tr("\n", " ").squeeze(" ") if block[0] == ?( block.sub!(/^\(/, '').sub!(/\)/, '') end - p << " {|#{block.strip}| ...}" + params << " {|#{block.strip}| ...}" end end - CGI.escapeHTML(p) + CGI.escapeHTML(params) end def create_source_code_file(code_body) -- cgit v1.2.3