Skip to content

Instantly share code, notes, and snippets.

@randallreedjr
Created March 22, 2016 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randallreedjr/f890c78a3a20a3680d23 to your computer and use it in GitHub Desktop.
Save randallreedjr/f890c78a3a20a3680d23 to your computer and use it in GitHub Desktop.
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