diff options
author | José Valim <jose.valim@gmail.com> | 2011-06-21 11:18:50 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-06-21 11:24:06 -0300 |
commit | 5a26b886455a9fda846109dbcf4595b107e392bc (patch) | |
tree | fd9ada2b21b433ab7901dc51dc30c409bb98f37c /railties/lib/rails/tasks/assets.rake | |
parent | 354709fe89a4cb9b26a6c19d377408bab2a07590 (diff) | |
download | rails-5a26b886455a9fda846109dbcf4595b107e392bc.tar.gz rails-5a26b886455a9fda846109dbcf4595b107e392bc.tar.bz2 rails-5a26b886455a9fda846109dbcf4595b107e392bc.zip |
Create an :assets group in the Gemfile.
This group is required by default only on development and test
(you can change it on config/application.rb).
`rake assets:precompile` will automatically add the assets group
to Rails.groups (and consequently Bundler.require) and should work
transparently.
Diffstat (limited to 'railties/lib/rails/tasks/assets.rake')
-rw-r--r-- | railties/lib/rails/tasks/assets.rake | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/railties/lib/rails/tasks/assets.rake b/railties/lib/rails/tasks/assets.rake index b872a54d08..ccd4d361bf 100644 --- a/railties/lib/rails/tasks/assets.rake +++ b/railties/lib/rails/tasks/assets.rake @@ -1,11 +1,16 @@ namespace :assets do desc "Compile all the assets named in config.assets.precompile" - task :precompile => :environment do - # Give assets access to asset_path - Sprockets::Helpers::RailsHelper + task :precompile do + if ENV["RAILS_GROUPS"].to_s.empty? + ENV["RAILS_GROUPS"] = "assets" + Kernel.exec $0, *ARGV + else + Rake::Task["environment"].invoke + Sprockets::Helpers::RailsHelper - assets = Rails.application.config.assets.precompile - Rails.application.assets.precompile(*assets) + assets = Rails.application.config.assets.precompile + Rails.application.assets.precompile(*assets) + end end desc "Remove compiled assets" |