Skip to content

Instantly share code, notes, and snippets.

@bobspryn
Created January 16, 2012 08:23
Show Gist options
  • Save bobspryn/1619728 to your computer and use it in GitHub Desktop.
Save bobspryn/1619728 to your computer and use it in GitHub Desktop.
filtering files in rake-pipeline
match "**/*.js" do
# block so uglify doesn't change name
uglify do |input|
input
end
# immediate has to come before modernizr
# block to filter if files even end up in a file at all
# need to decide between immediate and main (top of bottom of html file)
concat ['immediate.js', 'modernizr-2.0.min.js'], do |filename|
immedateGroup = ['immediate.js', 'modernizr-2.0.min.js']
laterGroup = ['main.js', 'jquery.form.js', 'jquery.animate-enhanced.min.js']
if immedateGroup.include?(filename.split('/').last)
"immediate.min." + VERS + ".js"
elsif laterGroup.include?(filename.split('/').last)
"main.min." + VERS + ".js"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment