Created
April 24, 2014 09:56
-
-
Save kates/11248805 to your computer and use it in GitHub Desktop.
Detect modified assets in a gemified rails engine
This file contains 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
task :fix_precompile_hook do | |
module Fixassets | |
module Assets | |
extend ActiveSupport::Concern | |
included do | |
def dependency_fresh_with_path_fix?(environment, dep) | |
path = dep.pathname.to_s | |
return false unless environment.paths.find { |env_path| path.starts_with? env_path } | |
dependency_fresh_without_path_fix?(environment, dep) | |
end | |
alias_method_chain :dependency_fresh?, :path_fix | |
end | |
end | |
end | |
Sprockets::Asset.send(:include, Fixassets::Assets) | |
end | |
task "assets:precompile" => :fix_precompile_hook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment