Permalink
Browse files

Check if AssetSync is defined before checking the run_on_precompile s…

…etting in the rake task.
  • Loading branch information...
freerobby committed Nov 1, 2012
1 parent 0e64e0e commit bce40f21af3b20d704d800f5b4168fa98d013046
Showing with 4 additions and 4 deletions.
  1. +2 −2 README.md
  2. +2 −2 lib/tasks/asset_sync.rake
View
@@ -322,11 +322,11 @@ If `AssetSync.config.run_on_precompile` is `true` (default), then assets will be
``` ruby
if Rake::Task.task_defined?("assets:precompile:nondigest")
Rake::Task["assets:precompile:nondigest"].enhance do
- Rake::Task["assets:sync"].invoke if AssetSync.config.run_on_precompile
+ Rake::Task["assets:sync"].invoke if defined?(AssetSync) && AssetSync.config.run_on_precompile
end
else
Rake::Task["assets:precompile"].enhance do
- Rake::Task["assets:sync"].invoke if AssetSync.config.run_on_precompile
+ Rake::Task["assets:sync"].invoke if defined?(AssetSync) && AssetSync.config.run_on_precompile
end
end
```
@@ -9,14 +9,14 @@ if Rake::Task.task_defined?("assets:precompile:nondigest")
Rake::Task["assets:precompile:nondigest"].enhance do
# Conditional execution needs to be inside the enhance block because the enhance block
# will get executed before yaml or Rails initializers.
- Rake::Task["assets:sync"].invoke if AssetSync.config.run_on_precompile
+ Rake::Task["assets:sync"].invoke if defined?(AssetSync) && AssetSync.config.run_on_precompile
end
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:sync"].invoke if AssetSync.config.run_on_precompile
+ Rake::Task["assets:sync"].invoke if defined?(AssetSync) && AssetSync.config.run_on_precompile
end
end

0 comments on commit bce40f2

Please sign in to comment.