From e44efac0865a66b0546e32b4c6f23605a98a5845 Mon Sep 17 00:00:00 2001 From: Ilya Grigorik Date: Thu, 4 Aug 2011 19:17:03 -0400 Subject: Clear out tmp/cache when assets:clean is invoked. Otherwise, if bad data is cached in tmp/clear then the next invocation of assets:precompile (or a regular incoming request) will pickup files from tmp without regenerating them from source. --- actionpack/lib/sprockets/assets.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/sprockets') diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake index 50278cffcd..0349b2865e 100644 --- a/actionpack/lib/sprockets/assets.rake +++ b/actionpack/lib/sprockets/assets.rake @@ -16,7 +16,7 @@ namespace :assets do end desc "Remove compiled assets" - task :clean => :environment do + task :clean => [:environment, 'tmp:cache:clear'] do assets = Rails.application.config.assets public_asset_path = Rails.public_path + assets.prefix rm_rf public_asset_path, :secure => true -- cgit v1.2.3 From ed5c6d254c9ef5d44a11159561fddde7a3033874 Mon Sep 17 00:00:00 2001 From: Ilya Grigorik Date: Thu, 4 Aug 2011 23:48:40 -0400 Subject: generate environment dependent asset digests If two different environments are configured to use the pipeline, but one has an extra step (such as compression) then without taking the environment into account you may end up serving wrong assets --- actionpack/lib/sprockets/railtie.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib/sprockets') diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb index c8438e6043..0c2eb5075b 100644 --- a/actionpack/lib/sprockets/railtie.rb +++ b/actionpack/lib/sprockets/railtie.rb @@ -20,6 +20,7 @@ module Sprockets app.assets = Sprockets::Environment.new(app.root.to_s) do |env| env.static_root = File.join(app.root.join('public'), config.assets.prefix) env.logger = ::Rails.logger + env.version = ::Rails.env + '-' + env.version if config.assets.cache_store != false env.cache = ActiveSupport::Cache.lookup_store(config.assets.cache_store) || ::Rails.cache -- cgit v1.2.3 From c0bfb5a63c926abcee8df26ed7b7598ef763463a Mon Sep 17 00:00:00 2001 From: Ilya Grigorik Date: Fri, 5 Aug 2011 22:55:56 -0700 Subject: use assets.version in asset checksum to allow user to easily override --- actionpack/lib/sprockets/railtie.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/sprockets') diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb index 0c2eb5075b..e1db3c52a3 100644 --- a/actionpack/lib/sprockets/railtie.rb +++ b/actionpack/lib/sprockets/railtie.rb @@ -20,7 +20,7 @@ module Sprockets app.assets = Sprockets::Environment.new(app.root.to_s) do |env| env.static_root = File.join(app.root.join('public'), config.assets.prefix) env.logger = ::Rails.logger - env.version = ::Rails.env + '-' + env.version + env.version = ::Rails.env + '-' + config.assets.version if config.assets.cache_store != false env.cache = ActiveSupport::Cache.lookup_store(config.assets.cache_store) || ::Rails.cache -- cgit v1.2.3