Created
March 22, 2016 16:40
-
-
Save randallreedjr/f890c78a3a20a3680d23 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 :coffee do | |
desc "Compile coffeescript source file into javascript" | |
task :compile, :input_file, :output_file do |t, args| | |
filename = args.input_file | |
coffee_file = File.open(filename, "r") | |
js_contents = CoffeeScript.compile(coffee_file) | |
coffee_file.close | |
output_filename = args.output_file | |
output = File.open("public/static/#{output_filename}","w" ) | |
output << js_contents | |
output.close | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment