turbo-sprockets-rails3 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,15 +36,7 @@ if defined?(Sprockets::StaticCompiler)
36
36
  # to calculate a digest of the concatenated source files
37
37
  asset = env.find_asset(logical_path, :process => false)
38
38
 
39
- # Force digest and path to UTF-8 for Ruby 1.9, otherwise YAML dumps ASCII-8BIT as !binary
40
- if RUBY_VERSION.to_f >= 1.9
41
- utf8_digest = asset.digest.force_encoding("UTF-8")
42
- utf8_path = logical_path.force_encoding("UTF-8")
43
- else
44
- utf8_digest, utf8_path = asset.digest, logical_path
45
- end
46
-
47
- @source_digests[utf8_path] = utf8_digest
39
+ @source_digests[logical_path] = asset.digest
48
40
 
49
41
  # Recompile if digest has changed or compiled digest file is missing
50
42
  current_digest_file = @current_digest_files[logical_path]
@@ -66,6 +58,14 @@ if defined?(Sprockets::StaticCompiler)
66
58
  end
67
59
  end
68
60
 
61
+ # Encode all keys and values as UTF-8 for Ruby 1.9, otherwise YAML stores them as !binary
62
+ if RUBY_VERSION.to_f >= 1.9
63
+ utf8_sources, utf8_digests = {}, {}
64
+ @source_digests.each { |k, v| utf8_sources[k.encode("UTF-8")] = v.encode("UTF-8") }
65
+ @digest_files.each { |k, v| utf8_digests[k.encode("UTF-8")] = v.encode("UTF-8") }
66
+ @source_digests, @digest_files = utf8_sources, utf8_digests
67
+ end
68
+
69
69
  if @manifest
70
70
  write_manifest(:source_digests => @source_digests, :digest_files => @digest_files)
71
71
  end
@@ -1,3 +1,3 @@
1
1
  module TurboSprockets
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
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.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: