Created
December 12, 2012 16:46
-
-
Save ilyakatz/4269402 to your computer and use it in GitHub Desktop.
Selective skip of asset compilation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#You'll need to add an eydeploy.rb with this file in either your root directory or in the config directory | |
module EY | |
module Serverside | |
class Task | |
def app_needs_assets_when_changed? | |
assets_modified = run "git diff --name-only #{last_revision} | grep '/assets/' | wc -l" | |
if assets_modified.output.to_i > 0 | |
# Call the original method to preserve behaviour. | |
app_needs_assets_orig? | |
else | |
# Keep the existing assets always! | |
keep_existing_assets | |
# App doesn't need assets. | |
return false | |
end | |
end | |
alias_method :app_needs_assets_orig?, app_needs_assets? | |
alias_method :app_needs_assets?, :app_needs_assets_when_changed? | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment