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

ruby-changes:14624

From: mame <ko1@a...>
Date: Fri, 29 Jan 2010 22:54:15 +0900 (JST)
Subject: [ruby-changes:14624] Ruby:r26469 (trunk): * lib/getoptlong.rb (set_options): ensure that the type of argument is

mame	2010-01-29 22:53:57 +0900 (Fri, 29 Jan 2010)

  New Revision: 26469

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26469

  Log:
    * lib/getoptlong.rb (set_options): ensure that the type of argument is
      Array, restoring this check that was deleted at r10239.  This caused
      rubyspec error.

  Modified files:
    trunk/ChangeLog
    trunk/lib/getoptlong.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26468)
+++ ChangeLog	(revision 26469)
@@ -1,3 +1,9 @@
+Fri Jan 29 22:49:21 2010  Yusuke Endoh  <mame@t...>
+
+	* lib/getoptlong.rb (set_options): ensure that the type of argument is
+	  Array, restoring this check that was deleted at r10239.  This caused
+	  rubyspec error.
+
 Fri Jan 29 12:59:33 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in (mingw): needs $(DEFFILE) for extension libraries.
Index: lib/getoptlong.rb
===================================================================
--- lib/getoptlong.rb	(revision 26468)
+++ lib/getoptlong.rb	(revision 26469)
@@ -282,8 +282,11 @@
     @canonical_names.clear
     @argument_flags.clear
 
-    arguments.each do |*arg|
-      arg = arg.first # TODO: YARV Hack
+    arguments.each do |arg|
+      if !arg.is_a?(Array)
+       raise ArgumentError, "the option list contains non-Array argument"
+      end
+
       #
       # Find an argument flag and it set to `argument_flag'.
       #

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

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