ruby-changes:53768
From: mame <ko1@a...>
Date: Mon, 26 Nov 2018 14:32:54 +0900 (JST)
Subject: [ruby-changes:53768] mame:r65985 (trunk): lib/rdoc/markup/: Remove wrong call to `=~` against Array
mame 2018-11-26 14:32:50 +0900 (Mon, 26 Nov 2018) New Revision: 65985 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65985 Log: lib/rdoc/markup/: Remove wrong call to `=~` against Array `@res` is an Array, so `@res =~ /\n\z/` calls `Object#=~` which always returns nil. I guess it should be `@res.last =~ /\n\z/`, but the change causes test failures. This bug was found during work for removal of `Object#=~`. [Feature #15231] Modified files: trunk/lib/rdoc/markup/to_markdown.rb trunk/lib/rdoc/markup/to_rdoc.rb Index: lib/rdoc/markup/to_markdown.rb =================================================================== --- lib/rdoc/markup/to_markdown.rb (revision 65984) +++ lib/rdoc/markup/to_markdown.rb (revision 65985) @@ -131,7 +131,7 @@ class RDoc::Markup::ToMarkdown < RDoc::M https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markup/to_markdown.rb#L131 @res << part end - @res << "\n" unless @res =~ /\n\z/ + @res << "\n" end ## Index: lib/rdoc/markup/to_rdoc.rb =================================================================== --- lib/rdoc/markup/to_rdoc.rb (revision 65984) +++ lib/rdoc/markup/to_rdoc.rb (revision 65985) @@ -234,7 +234,7 @@ class RDoc::Markup::ToRdoc < RDoc::Marku https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markup/to_rdoc.rb#L234 @res << part end - @res << "\n" unless @res =~ /\n\z/ + @res << "\n" end ## -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/