Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (33 sloc) 1.04 KB
# automates minifying jquery.isotope.js
# requires Google Closure Compiler
# from command line run:
# rake min COMPILER='path/to/compiler.jar'
file compiler = ENV["COMPILER"] || '../../resources/google-closure/compiler.jar'
js = 'jquery.isotope.js'
min_js = 'jquery.isotope.min.js'
desc "Generates #{min_js}"
task :min do
unless File.exists?( compiler )
puts "ERROR: Compiler not found at " + compiler
puts "Minifying jquery.isotope.js..."
sh "java -jar #{compiler} --js #{js} --js_output_file #{min_js}"
# Adds header comment
min = min_js ) min_js, 'w') do |f|
f.write File.readlines( js )[0..9].join()
f.write min
desc "Zips _site/ into on to Desktop"
task :zip do
# makes isotope-site/ directory
sh 'mkdir isotope-site;'
# copies _site/
sh 'cp -r _site/ isotope-site;'
# zips isotope-site/
sh 'zip -r ~/Desktop/ isotope-site/;'
# removes isotope-site/
sh 'rm -rf isotope-site;'
Something went wrong with that request. Please try again.