Created
November 23, 2008 21:22
-
-
Save dburger/28207 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :minifier do | |
def minify(files) | |
files.each do |file| | |
cmd = "java -jar lib/yuicompressor-2.3.1.jar #{file} -o #{file}" | |
puts cmd | |
ret = system(cmd) | |
raise "Minification failed for #{file}" if !ret | |
end | |
end | |
desc "minify" | |
task :minify => [:minify_js, :minify_css] | |
desc "minify javascript" | |
task :minify_js do | |
minify(FileList['public/javascripts/**/*.js']) | |
end | |
desc "minify css" | |
task :minify_css do | |
minify(FileList['public/stylesheets/**/*.css']) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment