summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-03-22 14:06:55 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-03-22 14:06:55 +0900
commit235aa7ad63d8cf77043a2f62f3c3e30fd6af6c05 (patch)
treec0ca229d25e62ebe8d04639b0aebcf9e7efdeb3f /ext
parentc5045830b7ed3bf664633871ca21fcfe03a42aa7 (diff)
Pass blocks to blocks as block parameters
Diffstat (limited to 'ext')
-rwxr-xr-xext/extmk.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index e52fbb4208..ffd64209ae 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -499,20 +499,18 @@ default_exclude_exts =
mandatory_exts = {}
withes, withouts = [["--with", nil], ["--without", default_exclude_exts]].collect {|w, d|
if !(w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any?
- d ? proc {|c1| d.any?(&c1)} : proc {true}
+ d ? proc {|&c1| d.any?(&c1)} : proc {true}
elsif (w = w.grep(String)).empty?
proc {true}
else
w = w.collect {|o| o.split(/,/)}.flatten
w.collect! {|o| o == '+' ? d : o}.flatten!
- proc {|c1| w.any?(&c1)}
+ proc {|&c1| w.any?(&c1)}
end
}
cond = proc {|ext, *|
- withes.call(proc {|n|
- !n or (mandatory_exts[ext] = true if File.fnmatch(n, ext))
- }) and
- !withouts.call(proc {|n| File.fnmatch(n, ext)})
+ withes.call {|n| !n or (mandatory_exts[ext] = true if File.fnmatch(n, ext))} and
+ !withouts.call {|n| File.fnmatch(n, ext)}
}
($extension || %w[*]).each do |e|
e = e.sub(/\A(?:\.\/)+/, '')