summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--ext/extmk.rb8
-rw-r--r--lib/optparse.rb4
3 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 82cfa667c8..9d5ec377d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jun 20 23:28:34 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb (parse_args): provisional catch-up for the recent changes.
+
+ * lib/optparse.rb (OptionParser::List#summarize, OptionParser#order!): ditto.
+
Tue Jun 20 11:07:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (proc_invoke): intercept break and return from lambda
@@ -14,9 +20,9 @@ Tue Jun 20 11:07:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_yield_0): fix confusion between lambda (which is a
property of a proc) and pcall (which depends on whether it's
- called via yield or call).
+ called via yield or call).
- * eval.c (rb_thread_yield): no need to specify YIELD_LAMBDA_CALL.
+ * eval.c (rb_thread_yield): no need to specify YIELD_LAMBDA_CALL.
* eval.c (rb_block_pass): update blkid in prot_tag.
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 1a8f6cf3c3..c3412d4eb6 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -213,10 +213,14 @@ def parse_args()
opts = nil
$optparser ||= OptionParser.new do |opts|
opts.on('-n') {$dryrun = true}
- opts.on('--[no-]extension [EXTS]', Array) do |v|
+ opts.on('--[no-]extension [EXTS]', Array) do |*v|
+ v.compact!
+ v = v[0] if v.size == 1 and !v[0]
$extension = (v == false ? [] : v)
end
- opts.on('--[no-]extstatic [STATIC]', Array) do |v|
+ opts.on('--[no-]extstatic [STATIC]', Array) do |*v|
+ v.compact!
+ v = v[0] if v.size == 1 and !v[0]
if ($extstatic = v) == false
$extstatic = []
elsif v
diff --git a/lib/optparse.rb b/lib/optparse.rb
index c79da48e01..6ecd7e3203 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -670,7 +670,7 @@ class OptionParser
list.each do |opt|
if opt.respond_to?(:summarize) # perhaps OptionParser::Switch
opt.summarize(*args, &block)
- elsif opt.empty?
+ elsif !opt or opt.empty?
yield("")
else
opt.each(&block)
@@ -1319,7 +1319,7 @@ class OptionParser
end
begin
opt, sw, val = sw.parse(rest, argv) {|*exc| raise(*exc)}
- sw.yield(*val) if sw
+ sw.yield(val) if sw
rescue ParseError
raise $!.set_option(arg, rest)
end