Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 66 lines (37 sloc) 2.95 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
093b546 @ndbroadbent Tweaked README [ci skip]
authored
3 * Speeds up the Rails 3 asset pipeline by only recompiling changed assets, based on a hash of their source files
5e48cb0 @ndbroadbent Updated README [ci skip]
authored
4 * Generates both non-fingerprinted and fingerprinted assets from a single compile
824d198 @ndbroadbent Added overrides for sprockets gem
authored
5
51c5f2e @ndbroadbent Updated README
authored
6 This is a backport of the work I've done for Rails 4.0.0, released as
7 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.)
8
9
10 ### Disclaimer
11
12 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).
13
533d1fd @ndbroadbent Updated README and build matrix
authored
14 ## Supported Versions
51c5f2e @ndbroadbent Updated README
authored
15
533d1fd @ndbroadbent Updated README and build matrix
authored
16 ### Ruby
17
162dced @ndbroadbent Updated README [ci skip]
authored
18 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
19
20 ### Rails
21
162dced @ndbroadbent Updated README [ci skip]
authored
22 This gem only supports Rails `3.2.0` or higher.
23 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
24
25 ## Usage
26
27 Just drop the gem in your `Gemfile`:
28
29 ```ruby
30 gem 'turbo-sprockets-rails3'
31 ```
32
33 Run `bundle`, and you're done!
34
35
36 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.
37
38 Go on, run `rake assets:precompile` again, and it should be a whole lot faster than before.
39
40 Enjoy your lightning fast deploys!
a908d64 @ndbroadbent Added debugging info
authored
41
039e6fa @ndbroadbent Removed asset cleaning code, since it's not relevant
authored
42 ## Deployments
a908d64 @ndbroadbent Added debugging info
authored
43
039e6fa @ndbroadbent Removed asset cleaning code, since it's not relevant
authored
44 ### Capistrano
a908d64 @ndbroadbent Added debugging info
authored
45
039e6fa @ndbroadbent Removed asset cleaning code, since it's not relevant
authored
46 `turbo-sprockets-rails3` should work out of the box with Capistrano.
a908d64 @ndbroadbent Added debugging info
authored
47
48 ### Heroku
49
50 You won't be able to do an 'incremental update' on heroku, since your `public/assets`
51 folder will be empty at the start of each push. However, this gem can still cut your
5e48cb0 @ndbroadbent Updated README [ci skip]
authored
52 precompile time in half, since it only needs to compile assets once.
a908d64 @ndbroadbent Added debugging info
authored
53
9ef2790 @ndbroadbent Update README [ci skip]
authored
54 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
55
5e48cb0 @ndbroadbent Updated README [ci skip]
authored
56 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`, make sure you have added a `heroku` remote to your repo, and 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
57
a908d64 @ndbroadbent Added debugging info
authored
58 ## Debugging
59
60 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`:
61
62 ```ruby
63 config.log_level = :debug
64 config.logger = Logger.new(STDOUT)
65 ```
Something went wrong with that request. Please try again.