Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A plugin to duck-punch asset packager and provide middleware to work on Heroku with a ROFS.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 tasks
Octocat-spinner-32 test
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 init.rb
Octocat-spinner-32 uninstall.rb
README
Heroku Asset Packager
===================

Asset Packager is an awesome plugin which will roll up all the fancy CSS and JS files which seem to accumulate with a large web application
and then strip them down and roll them into a nice minified ball. How this works, to me, is magic - and they only need a config file. I thought
I was in heaven until I tried to deploy my app onto Heroku.

Heroku, due to its nature, runs your app in a Read Only File System - basically this means that Asset Packager balks when it tries to generate
the asset package files on the first run (unless you do it manually and commit to source control... that just feels wrong).

So, heroku_asset_packager kind of monkey patches asset_packager and adds in some Rack middleware to do two things:
1. it redirects the destination where asset_packager will dump out its files to tmp/asset_packager/
2. it grabs any requests with /(stylesheets|javascripts)/*_packages.* and reads out the file as required.

Why? Well because we can write to tmp/ Heroku doesn't complain and the world is good once again.

Example
=======

No configuration necessary aside from setting up asset_packager.
Install with: script/plugin install 
When deploying to Heroku please ensure you set the HEROKU config value with the following: `heroku config:add HEROKU=true`

Tests
=====

I'm so deeply sorry, this is kind of like my first real plugin, and its rack based, and has a dependency on another plugin - so I'm struggling a little
with the testing etc. But I promise its coming - please don't shun me! (any assistance will be welcomed!)

Copyright (c) 2009 Matthew Savage (Amasses Industries), released under the MIT license
Something went wrong with that request. Please try again.