diff options
author | Sam Pohlenz <sam@sampohlenz.com> | 2011-09-01 09:23:51 +0930 |
---|---|---|
committer | Sam Pohlenz <sam@sampohlenz.com> | 2011-09-01 18:01:45 +0930 |
commit | 58b0c9734777a4610e812a48ee64881b4f88b107 (patch) | |
tree | 5bcd6db1816cfd41f34ca0c5f32ee7d92d4ffeaa /actionpack | |
parent | b93c3606cb74b191b5dce38984fce3713836a7e1 (diff) | |
download | rails-58b0c9734777a4610e812a48ee64881b4f88b107.tar.gz rails-58b0c9734777a4610e812a48ee64881b4f88b107.tar.bz2 rails-58b0c9734777a4610e812a48ee64881b4f88b107.zip |
assets:precompile should not append asset digests when config.assets.digest is false
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/sprockets/assets.rake | 9 |
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)$/ |