From 58b0c9734777a4610e812a48ee64881b4f88b107 Mon Sep 17 00:00:00 2001 From: Sam Pohlenz Date: Thu, 1 Sep 2011 09:23:51 +0930 Subject: assets:precompile should not append asset digests when config.assets.digest is false --- actionpack/lib/sprockets/assets.rake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake index f1fc7857a7..a8128d9a82 100644 --- a/actionpack/lib/sprockets/assets.rake +++ b/actionpack/lib/sprockets/assets.rake @@ -13,8 +13,7 @@ namespace :assets do # Ensure that action view is loaded and the appropriate sprockets hooks get executed ActionView::Base - # Always calculate digests and compile files - Rails.application.config.assets.digest = true + # Always compile files Rails.application.config.assets.compile = true config = Rails.application.config @@ -32,8 +31,10 @@ namespace :assets do end if asset = env.find_asset(logical_path) - manifest[logical_path] = asset.digest_path - filename = target.join(asset.digest_path) + asset_path = config.assets.digest ? asset.digest_path : logical_path + manifest[logical_path] = asset_path + filename = target.join(asset_path) + mkdir_p filename.dirname asset.write_to(filename) asset.write_to("#{filename}.gz") if filename.to_s =~ /\.(css|js)$/ -- cgit v1.2.3