aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/sprockets
diff options
context:
space:
mode:
authorMark J. Titorenko <mark@titorenko.net>2011-10-04 23:27:29 +0100
committerJosé Valim <jose.valim@gmail.com>2011-10-05 01:25:39 +0200
commit26a62a6552b19332f23cc4af87d74ae3ee4aa123 (patch)
tree246c2830d60f7bf2863acad45462c2853fafa78e /actionpack/lib/sprockets
parent42eda8f8a19e30e9d5de4e8963df1ee6ed8ce5a1 (diff)
downloadrails-26a62a6552b19332f23cc4af87d74ae3ee4aa123.tar.gz
rails-26a62a6552b19332f23cc4af87d74ae3ee4aa123.tar.bz2
rails-26a62a6552b19332f23cc4af87d74ae3ee4aa123.zip
only reinvoke if necessary
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/sprockets')
-rw-r--r--actionpack/lib/sprockets/assets.rake18
1 files changed, 16 insertions, 2 deletions
diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake
index 68d9a9ca31..15cba0c475 100644
--- a/actionpack/lib/sprockets/assets.rake
+++ b/actionpack/lib/sprockets/assets.rake
@@ -11,7 +11,14 @@ namespace :assets do
desc "Compile all the assets named in config.assets.precompile"
task :precompile do
- ruby_rake_task "assets:precompile:all"
+ if ENV['RAILS_GROUPS'].to_s.empty? || ENV['RAILS_ENV'].to_s.empty?
+ # We are currently running with no explicit bundler group
+ # and/or no explicit environment - we have to reinvoke rake to
+ # execute this task.
+ ruby_rake_task "assets:precompile:all"
+ else
+ Rake::Task["assets:precompile:all"].invoke
+ end
end
namespace :precompile do
@@ -58,7 +65,14 @@ namespace :assets do
desc "Remove compiled assets"
task :clean do
- ruby_rake_task "assets:clean:all"
+ if ENV['RAILS_GROUPS'].to_s.empty? || ENV['RAILS_ENV'].to_s.empty?
+ # We are currently running with no explicit bundler group
+ # and/or no explicit environment - we have to reinvoke rake to
+ # execute this task.
+ ruby_rake_task "assets:clean:all"
+ else
+ Rake::Task["assets:clean:all"].invoke
+ end
end
namespace :clean do