-
Notifications
You must be signed in to change notification settings - Fork 7
/
README
30 lines (21 loc) · 1.64 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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