summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-29 13:53:57 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-29 13:53:57 +0000
commitbc7ae41e0f8770000b38dd4be81cf331d58f6d1c (patch)
treed84053f1182c11f9c889c6e4a48191c18d82e974 /lib
parent9433d94cff528bfd169cb0eaa4d664a4bc0a5111 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/getoptlong.rb7
1 files changed, 5 insertions, 2 deletions
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'.
#