Skip to content

Instantly share code, notes, and snippets.

@kates
Created April 24, 2014 09:56
Show Gist options
  • Save kates/11248805 to your computer and use it in GitHub Desktop.
Save kates/11248805 to your computer and use it in GitHub Desktop.
Detect modified assets in a gemified rails engine
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