aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/getoptlong.rb7
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 17686d1b0a..7e18ff7d8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jan 29 22:49:21 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * 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@ruby-lang.org>
* configure.in (mingw): needs $(DEFFILE) for extension libraries.
diff --git a/lib/getoptlong.rb b/lib/getoptlong.rb
index 2d3b617d6b..7bd9ee55cc 100644
--- a/lib/getoptlong.rb
+++ b/lib/getoptlong.rb
@@ -282,8 +282,11 @@ class GetoptLong
@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'.
#