Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 68 lines (38 sloc) 3.105 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.
25 Rails `3.1.x` support is not available at this time, because it depends on an outdated version of `sprockets`.
51c5f2e @ndbroadbent Updated README
authored
26
27 ## Usage
28
29 Just drop the gem in your `Gemfile`:
30
31 ```ruby
32 gem 'turbo-sprockets-rails3'
33 ```
34
35 Run `bundle`, and you're done!
36
37
38 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.
39
40 Go on, run `rake assets:precompile` again, and it should be a whole lot faster than before.
41
42 Enjoy your lightning fast deploys!
a908d64 @ndbroadbent Added debugging info
authored
43
039e6fa @ndbroadbent Removed asset cleaning code, since it's not relevant
authored
44 ## Deployments
a908d64 @ndbroadbent Added debugging info
authored
45
039e6fa @ndbroadbent Removed asset cleaning code, since it's not relevant
authored
46 ### Capistrano
a908d64 @ndbroadbent Added debugging info
authored
47
039e6fa @ndbroadbent Removed asset cleaning code, since it's not relevant
authored
48 `turbo-sprockets-rails3` should work out of the box with Capistrano.
a908d64 @ndbroadbent Added debugging info
authored
49
50 ### Heroku
51
52 You won't be able to do an 'incremental update' on heroku, since your `public/assets`
53 folder will be empty at the start of each push. However, this gem can still cut your
5e48cb0 @ndbroadbent Updated README [ci skip]
authored
54 precompile time in half, since it only needs to compile assets once.
a908d64 @ndbroadbent Added debugging info
authored
55
9ef2790 @ndbroadbent Update README [ci skip]
authored
56 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
57
9ad79e4 @ndbroadbent README update [ci skip]
authored
58 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
59
a908d64 @ndbroadbent Added debugging info
authored
60 ## Debugging
61
62 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`:
63
64 ```ruby
65 config.log_level = :debug
66 config.logger = Logger.new(STDOUT)
67 ```
Something went wrong with that request. Please try again.