Permalink
Browse files

New version 0.3.x will support Rails 3.2.9 sprockets changes. Bugs wi…

…ll still be fixed on 0.2.x
  • Loading branch information...
1 parent f5157ea commit 1aa29210d9a257525fbd096c1093ac79b80b5be1 @ndbroadbent committed Oct 30, 2012
@@ -26,37 +26,33 @@ def initialize(env, target, paths, options = {})
def compile
start_time = Time.now.to_f
- env.each_logical_path do |logical_path|
- if File.basename(logical_path)[/[^\.]+/, 0] == 'index'
- logical_path.sub!(/\/index\./, '.')
- end
- next unless compile_path?(logical_path)
-
+ env.each_logical_path(paths) do |logical_path|
# Fetch asset without any processing or compression,
# to calculate a digest of the concatenated source files
- if asset = env.find_asset(logical_path, :process => false)
- @source_digests[logical_path] = asset.digest
-
- # Recompile if digest has changed or compiled digest file is missing
- current_digest_file = @current_digests[logical_path]
-
- if @source_digests[logical_path] != @current_source_digests[logical_path] ||
- !(current_digest_file && File.exists?("#{@target}/#{current_digest_file}"))
+ next unless asset = env.find_asset(logical_path, :process => false)
+ @source_digests[logical_path] = asset.digest
- if asset = env.find_asset(logical_path)
- @digests[logical_path] = write_asset(asset)
- # Update current_digests with new hash, for future assets to reference
- @current_digests[logical_path] = asset.digest_path
- end
+ # Recompile if digest has changed or compiled digest file is missing
+ current_digest_file = @current_digests[logical_path]
- else
- # Set asset file from manifest.yml
- digest_file = @current_digests[logical_path]
- @digests[logical_path] = digest_file
+ if @source_digests[logical_path] != @current_source_digests[logical_path] ||
+ !(current_digest_file && File.exists?("#{@target}/#{current_digest_file}"))
- env.logger.debug "Not compiling #{logical_path}, sources digest has not changed " <<
- "(#{@source_digests[logical_path][0...7]})"
+ if asset = env.find_asset(logical_path)
+ digest_path = write_asset(asset)
+ @digests[asset.logical_path] = digest_path
+ @digests[aliased_path_for(asset.logical_path)] = digest_path
+ # Update current_digests with new hash, for future assets to reference
+ @current_digests[asset.logical_path] = asset.digest_path
end
+ else
+ # Set asset file from manifest.yml
+ digest_path = @current_digests[logical_path]
+ @digests[logical_path] = digest_path
+ @digests[aliased_path_for(logical_path)] = digest_path
+
+ env.logger.debug "Not compiling #{logical_path}, sources digest has not changed " <<
+ "(#{@source_digests[logical_path][0...7]})"
end
end
@@ -1,3 +1,3 @@
module TurboSprockets
- VERSION = "0.2.10"
+ VERSION = "0.3.0"
end
@@ -15,5 +15,5 @@ Gem::Specification.new do |s|
s.test_files = Dir["test/**/*"]
s.add_runtime_dependency "sprockets", ">= 2.0.0"
- s.add_runtime_dependency "railties", ">= 3.1.0", '< 3.2.9'
+ s.add_runtime_dependency "railties", "> 3.2.8", '< 4.0.0'
end

3 comments on commit 1aa2921

@maletor
maletor commented on 1aa2921 Nov 9, 2012

What exactly does 3.2.9 fix for turbo sprockets?

@ndbroadbent
Owner

Hi, it's just a matter of compatibility. Rails 3.2.9 bumps the sprockets version, as well as changing the sprockets wrapper code in the rake tasks. The changes are substantial enough to warrant separate versions of the turbo-sprockets-rails3 gem, instead of trying to support all the differences with conditionals in the code.

@chrise86

This has become essential with the latest security releases, so thanks very much :)

Please sign in to comment.