[前][次][番号順一覧][スレッド一覧]

ruby-changes:49914

From: nobu <ko1@a...>
Date: Thu, 25 Jan 2018 08:17:25 +0900 (JST)
Subject: [ruby-changes:49914] nobu:r62032 (trunk): optparse.rb: literal newline

nobu	2018-01-25 08:17:20 +0900 (Thu, 25 Jan 2018)

  New Revision: 62032

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62032

  Log:
    optparse.rb: literal newline
    
    * lib/optparse.rb (OptionParser#summarize): use literal newline to
      join option summaries as IO#puts does, not the special gloval
      variable $/.

  Modified files:
    trunk/lib/optparse.rb
Index: lib/optparse.rb
===================================================================
--- lib/optparse.rb	(revision 62031)
+++ lib/optparse.rb	(revision 62032)
@@ -1237,7 +1237,7 @@ XXX https://github.com/ruby/ruby/blob/trunk/lib/optparse.rb#L1237
   # +indent+:: Indentation, defaults to @summary_indent.
   #
   def summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent, &blk)
-    blk ||= proc {|l| to << (l.index($/, -1) ? l : l + $/)}
+    blk ||= proc {|l| to << (l.index(nl, -1) ? l : l + nl)}
     visit(:summarize, {}, {}, width, max, indent, &blk)
     to
   end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]