Here are all things I have tried:
files = FileList.new("c:/temp/**/*") do |file|
file.exclude("c:/temp/logs/")
end
files = FileList.new("c:/temp/**/*") do |file|
file.exclude("c:/temp/logs")
end
files = FileList.new("c:/temp/**/*") do |file|
file.exclude("c:/temp/logs/*.*")
end
files = FileList.new("c:/temp/**/*") do |file|
file.exclude("c:/temp/logs/**/*")
end
files = FileList.new("c:/temp/**/*") do |file|
file.exclude("c:/temp/**/logs/")
end
rake version is 0.9.2.2 and Ruby version is 193. all doesn't work. How should I exclude a directory in a filelist?
I'm assuming you're trying to get a listing of all files under
c:/tmp
except for anything in (and including) thec:/tmp/logs
folder:[Edit] See the documentation for
FileList#exclude
for more details. For example, to exclude multiple directories you can either add multiple string/regex arguments, modify the regular expression to match all directory patterns to be excluded, or do something similar in a block.