Skip to content

Instantly share code, notes, and snippets.

@rweald
Created June 1, 2011 19:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rweald/1003158 to your computer and use it in GitHub Desktop.
Save rweald/1003158 to your computer and use it in GitHub Desktop.
Using Barista with Jammit to package and compile CoffeeScript
# simply run rake jammit:package to compile your coffeescript and then package up all your assets
# including the newly compiled javascripts
namespace :jammit do
task :package do
Rake::Task["barista:brew"].invoke
Jammit.package!
end
end
@davidglivar
Copy link

I'm curious... What's the context here? As in, which file are you adding this to?

@rweald
Copy link
Author

rweald commented Aug 19, 2011

I apologize for the ambiguity. This is a custom rake task that I have in lib/tasks of a Rails 3.0 project. I use it to compile my coffeescript into the public/javascripts folder where Jammit can then bundle it up as part of my assets package.
Quite handy for heroku if you don't want to have to deal with getting coffeescript to compile on heroku. Simply run this task as part of a git commit hook before you push up the heroku.

You can just run:

rake jammit:package

@davidglivar
Copy link

Thanks rweald, I'll have to remember this bit when I start experimenting with heroku.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment