Pass blocks to blocks as block parameters
This commit is contained in:
parent
c5045830b7
commit
235aa7ad63
10
ext/extmk.rb
10
ext/extmk.rb
@ -499,20 +499,18 @@ default_exclude_exts =
|
|||||||
mandatory_exts = {}
|
mandatory_exts = {}
|
||||||
withes, withouts = [["--with", nil], ["--without", default_exclude_exts]].collect {|w, d|
|
withes, withouts = [["--with", nil], ["--without", default_exclude_exts]].collect {|w, d|
|
||||||
if !(w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any?
|
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?
|
elsif (w = w.grep(String)).empty?
|
||||||
proc {true}
|
proc {true}
|
||||||
else
|
else
|
||||||
w = w.collect {|o| o.split(/,/)}.flatten
|
w = w.collect {|o| o.split(/,/)}.flatten
|
||||||
w.collect! {|o| o == '+' ? d : o}.flatten!
|
w.collect! {|o| o == '+' ? d : o}.flatten!
|
||||||
proc {|c1| w.any?(&c1)}
|
proc {|&c1| w.any?(&c1)}
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
cond = proc {|ext, *|
|
cond = proc {|ext, *|
|
||||||
withes.call(proc {|n|
|
withes.call {|n| !n or (mandatory_exts[ext] = true if File.fnmatch(n, ext))} and
|
||||||
!n or (mandatory_exts[ext] = true if File.fnmatch(n, ext))
|
!withouts.call {|n| File.fnmatch(n, ext)}
|
||||||
}) and
|
|
||||||
!withouts.call(proc {|n| File.fnmatch(n, ext)})
|
|
||||||
}
|
}
|
||||||
($extension || %w[*]).each do |e|
|
($extension || %w[*]).each do |e|
|
||||||
e = e.sub(/\A(?:\.\/)+/, '')
|
e = e.sub(/\A(?:\.\/)+/, '')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user