Skip to content

Commit

Permalink
Version 0.2.12, fix the asset_sync rake task enhancement in Rails 3.2…
Browse files Browse the repository at this point in the history
… (still supporting earlier releases)

* Turns out this was an issue with Rails handling of the config.assets.digest parameter
* When running rake assets:precompile this config variable is modified by Rails
* So it therefore cannot be depended on to test wether to enhance the nondigest task or not
* The solution is to always enhance assets:precompile:nondigest if it exists.
  • Loading branch information
davidjrice committed Mar 4, 2012
1 parent 6d81959 commit dfccf31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/asset_sync/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module AssetSync
VERSION = "0.2.11"
VERSION = "0.2.12"
end
7 changes: 2 additions & 5 deletions lib/tasks/asset_sync.rake
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# Rails 3.2 compatibility
if Rails.application.config.assets.digest
if Rake::Task.task_defined?("assets:precompile:nondigest")
Rake::Task["assets:precompile:nondigest"].enhance do
Rake::Task["assets:environment"].invoke if Rake::Task.task_defined?("assets:environment")
AssetSync.sync
end
# Rails 3.1.x compatibility
else
Rake::Task["assets:precompile"].enhance do
# rails 3.1.1 will clear out Rails.application.config if the env vars
# RAILS_GROUP and RAILS_ENV are not defined. We need to reload the
# assets environment in this case.
Rake::Task["assets:environment"].invoke if Rake::Task.task_defined?("assets:environment")
# Rake::Task["assets:environment"].invoke if Rake::Task.task_defined?("assets:environment")
AssetSync.sync
end
end

0 comments on commit dfccf31

Please sign in to comment.