diff options
Diffstat (limited to 'actionpack/lib/sprockets/assets.rake')
-rw-r--r-- | actionpack/lib/sprockets/assets.rake | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake index 5698f22080..7ee82ee530 100644 --- a/actionpack/lib/sprockets/assets.rake +++ b/actionpack/lib/sprockets/assets.rake @@ -19,7 +19,8 @@ namespace :assets do config = Rails.application.config env = Rails.application.assets - target = Rails.root.join("public#{config.assets.prefix}") + target = Pathname.new(File.join(Rails.public_path, config.assets.prefix)) + manifest = {} if env.respond_to?(:each_logical_path) config.assets.precompile.each do |path| @@ -31,6 +32,7 @@ namespace :assets do end if asset = env.find_asset(logical_path) + manifest[logical_path] = asset.digest_path filename = target.join(asset.digest_path) mkdir_p filename.dirname asset.write_to(filename) @@ -44,6 +46,12 @@ namespace :assets do assets << {:to => target} env.precompile(*assets) end + + if config.assets.manifest + File.open("#{target}/manifest.yml", 'w') do |f| + YAML.dump(manifest, f) + end + end end end |