Skip to content
Newer
Older
100644 78 lines (43 sloc) 3.33 KB
533d1fd @ndbroadbent Updated README and build matrix
authored
1 # Turbo Sprockets for Rails 3.2.x
824d198 @ndbroadbent Added overrides for sprockets gem
authored
2
31e827e @ndbroadbent Added build status badge [ci skip]
authored
3 [![Build Status](https://secure.travis-ci.org/ndbroadbent/turbo-sprockets-rails3.png)](http://travis-ci.org/ndbroadbent/turbo-sprockets-rails3)
4
927e604 @ndbroadbent Update README [ci skip]
authored
5 * Speeds up your Rails 3 `rake assets:precompile` by only recompiling changed assets, based on a hash of their source files
6 * Only compiles once to generate both fingerprinted and non-fingerprinted assets
824d198 @ndbroadbent Added overrides for sprockets gem
authored
7
51c5f2e @ndbroadbent Updated README
authored
8 This is a backport of the work I've done for Rails 4.0.0, released as
9 a gem for Rails 3.2.x. (See [sprockets-rails #21](https://github.com/rails/sprockets-rails/pull/21) and [sprockets #367](https://github.com/sstephenson/sprockets/pull/367) for the Rails 4 pull requests.)
10
11
12 ### Disclaimer
13
14 Please test this out thoroughly on your local machine before deploying to a production site, and open an issue on GitHub if you have any problems. By using this software you agree to the terms and conditions in the [MIT license](https://github.com/ndbroadbent/turbo-sprockets-rails3/blob/master/MIT-LICENSE).
15
533d1fd @ndbroadbent Updated README and build matrix
authored
16 ## Supported Versions
51c5f2e @ndbroadbent Updated README
authored
17
533d1fd @ndbroadbent Updated README and build matrix
authored
18 ### Ruby
19
162dced @ndbroadbent Updated README [ci skip]
authored
20 All versions of Ruby that are supported by Rails `3.2.x`, including `1.9.3`, `1.9.2`, `1.8.7` and REE.
533d1fd @ndbroadbent Updated README and build matrix
authored
21
22 ### Rails
23
162dced @ndbroadbent Updated README [ci skip]
authored
24 This gem only supports Rails `3.2.0` or higher.
51c5f2e @ndbroadbent Updated README
authored
25
26 ## Usage
27
28 Just drop the gem in your `Gemfile`:
29
30 ```ruby
31 gem 'turbo-sprockets-rails3'
32 ```
33
34 Run `bundle`, and you're done!
35
36
37 Test it out by running `rake assets:precompile`. When it's finished, your `public/assets/manifest.yml` file should include a `:source_digests` hash for your assets.
38
39 Go on, run `rake assets:precompile` again, and it should be a whole lot faster than before.
40
41 Enjoy your lightning fast deploys!
a908d64 @ndbroadbent Added debugging info
authored
42
faf022a @ndbroadbent Updated README with compatibility section [ci skip]
authored
43 ## Compatibility
44
45 ### [asset_sync](https://github.com/rumblelabs/asset_sync)
46
47 Fully compatible. Just don't use the experimental `AssetSync.config.manifest = true` configuration option until
c697e7f @ndbroadbent Update README [ci skip]
authored
48 [my asset_sync patch](https://github.com/rumblelabs/asset_sync/pull/110) has been merged.
faf022a @ndbroadbent Updated README with compatibility section [ci skip]
authored
49
50 <hr/>
51
52 Please let me know if you have any problems with other gems, and I will either fix it, or make a note of the problem here.
53
039e6fa @ndbroadbent Removed asset cleaning code, since it's not relevant
authored
54 ## Deployments
a908d64 @ndbroadbent Added debugging info
authored
55
039e6fa @ndbroadbent Removed asset cleaning code, since it's not relevant
authored
56 ### Capistrano
a908d64 @ndbroadbent Added debugging info
authored
57
039e6fa @ndbroadbent Removed asset cleaning code, since it's not relevant
authored
58 `turbo-sprockets-rails3` should work out of the box with Capistrano.
a908d64 @ndbroadbent Added debugging info
authored
59
60 ### Heroku
61
62 You won't be able to do an 'incremental update' on heroku, since your `public/assets`
63 folder will be empty at the start of each push. However, this gem can still cut your
5e48cb0 @ndbroadbent Updated README [ci skip]
authored
64 precompile time in half, since it only needs to compile assets once.
a908d64 @ndbroadbent Added debugging info
authored
65
9ef2790 @ndbroadbent Update README [ci skip]
authored
66 If you want to make the most of `turbo-sprockets-rails3`, you can run `assets:precompile` on your local machine and commit the compiled assets. When you push compiled assets to Heroku, it will automatically skip the `assets:precompile` task.
c487013 @ndbroadbent Added section for heroku deploy rake task
authored
67
9ad79e4 @ndbroadbent README update [ci skip]
authored
68 I've automated this process in a Rake task for my own projects. My task creates a deployment repo at `tmp/heroku_deploy` so that you can keep working while deploying, and it also rebases and amends the assets commit to keep your repo's history from growing out of control. You can find the deploy task in a gist at https://gist.github.com/3802355. Save this file to `lib/tasks/deploy.rake`, and make sure you have added a `heroku` remote to your repo. You will now be able to run `rake deploy` to deploy your app to Heroku.
c487013 @ndbroadbent Added section for heroku deploy rake task
authored
69
a908d64 @ndbroadbent Added debugging info
authored
70 ## Debugging
71
72 If you would like to view debugging information in your terminal during the `assets:precompile` task, add the following lines to the bottom of `config/environments/production.rb`:
73
74 ```ruby
75 config.log_level = :debug
76 config.logger = Logger.new(STDOUT)
77 ```
Something went wrong with that request. Please try again.