diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2011-08-30 16:30:53 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2011-08-31 13:12:25 -0500 |
commit | d0b3937b8fe2cbc4385e843d47249af3e7181a83 (patch) | |
tree | ed3223e40c61d9003008d56a12de414153b425a0 /actionpack | |
parent | f236e00189b5a6cf0cebac5c275f64d41d73428d (diff) | |
download | rails-d0b3937b8fe2cbc4385e843d47249af3e7181a83.tar.gz rails-d0b3937b8fe2cbc4385e843d47249af3e7181a83.tar.bz2 rails-d0b3937b8fe2cbc4385e843d47249af3e7181a83.zip |
Set default location of manifest with config.assets.manifest
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/sprockets/assets.rake | 3 | ||||
-rw-r--r-- | actionpack/lib/sprockets/railtie.rb | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake index 54907abb39..6f38ece0c3 100644 --- a/actionpack/lib/sprockets/assets.rake +++ b/actionpack/lib/sprockets/assets.rake @@ -21,6 +21,7 @@ namespace :assets do env = Rails.application.assets target = Pathname.new(File.join(Rails.public_path, config.assets.prefix)) manifest = {} + manifest_path = config.assets.manifest || target if env.respond_to?(:each_logical_path) config.assets.precompile.each do |path| @@ -47,7 +48,7 @@ namespace :assets do env.precompile(*assets) end - File.open("#{target}/manifest.yml", 'w') do |f| + File.open("#{manifest_path}/manifest.yml", 'w') do |f| YAML.dump(manifest, f) end end diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb index 4adfd000f8..7927b7bc2c 100644 --- a/actionpack/lib/sprockets/railtie.rb +++ b/actionpack/lib/sprockets/railtie.rb @@ -26,7 +26,13 @@ module Sprockets end end - if File.exist?(path = File.join(Rails.public_path, config.assets.prefix, "manifest.yml")) + if config.assets.manifest + path = File.join(config.assets.manifest, "manifest.yml") + else + path = File.join(Rails.public_path, config.assets.prefix, "manifest.yml") + end + + if File.exist?(path) config.assets.digests = YAML.load_file(path) end |