1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

use rake tasks to set the default environment variables. fixes #2126

This commit is contained in:
Aaron Patterson 2011-07-21 15:30:28 -07:00
parent bb7e35531e
commit 5b6121aa34

View file

@ -1,17 +1,17 @@
namespace :assets do
# Ensures the RAILS_GROUPS environment variable is set
task :ensure_env do
ENV["RAILS_GROUPS"] ||= "assets"
end
desc "Compile all the assets named in config.assets.precompile"
task :precompile do
if ENV["RAILS_GROUPS"].to_s.empty?
ENV["RAILS_GROUPS"] = "assets"
Kernel.exec $0, *ARGV
else
task :precompile => :ensure_env do
Rake::Task["environment"].invoke
Sprockets::Helpers::RailsHelper
assets = Rails.application.config.assets.precompile
Rails.application.assets.precompile(*assets)
end
end
desc "Remove compiled assets"
task :clean => :environment do