I have a rakefile which uses jsmin to minify the files. one thing that I need to do is that is to have a array of files which will serve as a blacklist which jsmin wouldn't include in when running the minify script.
jsFolder = "./scripts"
cssFolder = "./stylesheets"
blackList = [blackListedFile.js] #this is what i need.
minifiedFileRootPath = "./"
task :minify_each_file, [:type] do |t, args|
args.with_defaults(:type => "js")
sourceFolder = args.type == 'js' ? jsFolder : cssFolder
listOfFilesToMinify = Dir.glob(sourceFolder << "/**/*." << args.type )
listOfFilesToMinify.each do |sourceFile|
minifiedFile = sourceFile.sub("."+ args.type,".min" + args.type)
puts minifiedFile
puts sourceFile
minifyone sourceFile, minifiedFile
end
end
Change:
listOfFilesToMinify.each do |sourceFile|
to
(listOfFilesToMinify - blackList).each do |sourceFile|
And use the following syntax for the blacklist array:
blackList = %w{foo bar}
It should work fine.