Created
May 9, 2011 21:12
-
-
Save aledalgrande/963428 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 :release do | |
task :js => :environment do | |
puts "Compiling coffeescript to javascript..." | |
[...] | |
File.open("#{release_dir}/example.js", 'w') do |file| | |
file.write CoffeeScript.compile(File.read("#{dev_dir}/example.coffee")) | |
end | |
puts "Coffeescript compiled" | |
puts "Closure Compiler: minifying" | |
raw = File.read("#{release_dir}/example.js") | |
File.open("#{release_dir}/example.js", 'w') do |f| | |
output = Closure::Compiler.new.compile(raw) | |
f.write "/**\n Copyright 2011 Alessandro Dal Grande\n\n Example #{I18n.l Time.now}\n*/" | |
f.write output | |
end | |
puts "Closure Compiler: success" | |
end | |
end | |
# EDIT: added the closure compiler call, that went lost in the first version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment