Permalink
Browse files

don't munge the environment, let rake do that for us

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent b41bd96 commit ee51cc30ff93201c9e76e7fcfa2d298e4e1568c3 @mjtko mjtko committed with josevalim Oct 4, 2011
Showing with 3 additions and 5 deletions.
  1. +3 −5 actionpack/lib/sprockets/assets.rake
@@ -2,15 +2,15 @@ require "fileutils"
namespace :assets do
def ruby_rake_task(task)
- args = [$0, task]
+ env = ENV['RAILS_ENV'] || 'production'
+ groups = ENV['RAILS_GROUPS'] || 'assets'
+ args = [$0, task,"RAILS_ENV=#{env}","RAILS_GROUPS=#{groups}"]
args << "--trace" if Rake.application.options.trace
ruby *args
end
desc "Compile all the assets named in config.assets.precompile"
task :precompile do
- ENV["RAILS_GROUPS"] ||= "assets"
- ENV["RAILS_ENV"] ||= "production"
ruby_rake_task "assets:precompile:all"
end
@@ -58,8 +58,6 @@ namespace :assets do
desc "Remove compiled assets"
task :clean do
- ENV["RAILS_GROUPS"] ||= "assets"
- ENV["RAILS_ENV"] ||= "production"
ruby_rake_task "assets:clean:all"
end

0 comments on commit ee51cc3

Please sign in to comment.