Created
February 8, 2011 04:19
-
-
Save zzak/815843 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'coffee-script' | |
desc "compile coffee-scripts from ./src to ./public/views" | |
task :coffee do | |
source = "#{File.dirname(__FILE__)}/src/" | |
javascripts = "#{File.dirname(__FILE__)}/public/javascripts/" | |
Dir.foreach(source) do |cf| | |
unless cf == '.' || cf == '..' | |
js = CoffeeScript.compile File.read("#{source}#{cf}") | |
open "#{javascripts}#{cf.gsub('.coffee', '.js')}", 'w' do |f| | |
f.puts js | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment