turbo-sprockets-rails3 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -45,6 +45,11 @@ You won't be able to do an 'incremental update' on heroku, since your `public/as
45
45
  folder will be empty at the start of each push. However, this gem can still cut your
46
46
  precompile time in half, since it only compiles assets once to generate both digest and non-digest assets.
47
47
 
48
+ If you want to make the most of `turbo-sprockets-rails3`, you can run `assets:precompile` on your local machine
49
+ and commit the compiled assets. When you push compiled assets to Heroku, it automatically skips the `assets:precompile` task.
50
+
51
+ I've automated this process in a Rake task for my own projects. It uses a temporary deploy repo so you can keep working, and it also rebases and amends the assets commit so your repo doesn't grow out of control. You can find my deploy task in a gist at https://gist.github.com/3802355. Save this file to `lib/tasks/deploy.rake`, and run `rake deploy` to deploy your app to Heroku.
52
+
48
53
  ## Debugging
49
54
 
50
55
  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`:
@@ -31,8 +31,12 @@ module Sprockets
31
31
  # to calculate a digest of the concatenated source files
32
32
  asset = env.find_asset(logical_path, :process => false)
33
33
 
34
- # Force digest to UTF-8, otherwise YAML dumps ASCII-8BIT as !binary
35
- @source_digests[logical_path] = asset.digest.force_encoding("UTF-8")
34
+ # Force digest to UTF-8 for Ruby 1.9, otherwise YAML dumps ASCII-8BIT as !binary
35
+ @source_digests[logical_path] = if RUBY_VERSION.to_f >= 1.9
36
+ asset.digest.force_encoding("UTF-8")
37
+ else
38
+ asset.digest
39
+ end
36
40
 
37
41
  # Recompile if digest has changed or compiled digest file is missing
38
42
  current_digest_file = @current_digest_files[logical_path]
@@ -55,7 +59,7 @@ module Sprockets
55
59
  end
56
60
 
57
61
  if @manifest
58
- write_manifest(source_digests: @source_digests, digest_files: @digest_files)
62
+ write_manifest(:source_digests => @source_digests, :digest_files => @digest_files)
59
63
  end
60
64
 
61
65
  # Store digests in Rails config. (Important if non-digest is run after primary)
@@ -1,3 +1,3 @@
1
1
  module TurboSprockets
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo-sprockets-rails3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-28 00:00:00.000000000 Z
12
+ date: 2012-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sprockets