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

ruby-changes:1992

From: ko1@a...
Date: 22 Sep 2007 06:02:33 +0900
Subject: [ruby-changes:1992] nobu - Ruby:r13483 (ruby_1_8, trunk): * lib/optparse.rb (OptionParser::List::summarize): use each_line if

nobu	2007-09-22 06:02:13 +0900 (Sat, 22 Sep 2007)

  New Revision: 13483

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/optparse.rb
    trunk/ChangeLog
    trunk/lib/optparse.rb

  Log:
    * lib/optparse.rb (OptionParser::List::summarize): use each_line if
      defined rather than each.  [ruby-Patches-14096]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=13483&r2=13482
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13483&r2=13482
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/optparse.rb?r1=13483&r2=13482
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/lib/optparse.rb?r1=13483&r2=13482

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 13482)
+++ ChangeLog	(revision 13483)
@@ -1,3 +1,8 @@
+Sat Sep 22 06:02:11 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/optparse.rb (OptionParser::List::summarize): use each_line if
+	  defined rather than each.  [ruby-Patches-14096]
+
 Sat Sep 22 05:19:49 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/stringio/stringio.c (strio_init): separate from strio_initialize
Index: lib/optparse.rb
===================================================================
--- lib/optparse.rb	(revision 13482)
+++ lib/optparse.rb	(revision 13483)
@@ -632,8 +632,10 @@
       list.each do |opt|
         if opt.respond_to?(:summarize) # perhaps OptionParser::Switch
           opt.summarize(*args, &block)
-        elsif !opt or opt.empty?
+        elsif !opt
           yield("")
+        elsif opt.respond_to?(:each_line)
+          opt.each_line(&block)
         else
           opt.each(&block)
         end
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 13482)
+++ ruby_1_8/ChangeLog	(revision 13483)
@@ -1,3 +1,8 @@
+Sat Sep 22 06:02:11 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/optparse.rb (OptionParser::List::summarize): use each_line if
+	  defined rather than each.  [ruby-Patches-14096]
+
 Sat Sep 22 05:19:49 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/stringio/stringio.c (strio_init): separate from strio_initialize
Index: ruby_1_8/lib/optparse.rb
===================================================================
--- ruby_1_8/lib/optparse.rb	(revision 13482)
+++ ruby_1_8/lib/optparse.rb	(revision 13483)
@@ -633,8 +633,10 @@
       list.each do |opt|
         if opt.respond_to?(:summarize) # perhaps OptionParser::Switch
           opt.summarize(*args, &block)
-        elsif !opt or opt.empty?
+        elsif !opt
           yield("")
+        elsif opt.respond_to?(:each_line)
+          opt.each_line(&block)
         else
           opt.each(&block)
         end

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

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