aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-09-01 01:59:58 -0700
committerJosé Valim <jose.valim@gmail.com>2011-09-01 01:59:58 -0700
commitda516e8f544c591bbebbfd8461c60e31ecc76d22 (patch)
tree5bcd6db1816cfd41f34ca0c5f32ee7d92d4ffeaa /actionpack
parentb93c3606cb74b191b5dce38984fce3713836a7e1 (diff)
parent58b0c9734777a4610e812a48ee64881b4f88b107 (diff)
downloadrails-da516e8f544c591bbebbfd8461c60e31ecc76d22.tar.gz
rails-da516e8f544c591bbebbfd8461c60e31ecc76d22.tar.bz2
rails-da516e8f544c591bbebbfd8461c60e31ecc76d22.zip
Merge pull request #2788 from spohlenz/precompile-without-digests-master
assets:precompile should not append asset digests when config.assets.digest is false
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/sprockets/assets.rake9
1 files changed, 5 insertions, 4 deletions
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)$/