Permalink
Browse files

Merge pull request #22 from heroku/asset_compilation_message

Fixes #19.
  • Loading branch information...
hone committed Jun 13, 2012
2 parents 30f1303 + 89334e2 commit 289337875c12926fac29bab4b98486f432e3abb8
Showing with 9 additions and 4 deletions.
  1. +3 −3 lib/language_pack/rails3.rb
  2. +6 −1 lib/language_pack/ruby.rb
@@ -47,12 +47,12 @@ def run_assets_precompile_rake_task
ENV["RAILS_ENV"] ||= "production"
puts "Running: rake assets:precompile"
- rake_output = ""
- rake_output << run("env PATH=$PATH:bin bundle exec rake assets:precompile 2>&1")
- puts rake_output
+ require 'benchmark'
+ time = Benchmark.realtime { pipe("env PATH=$PATH:bin bundle exec rake assets:precompile 2>&1") }
if $?.success?
log "assets_precompile", :status => "success"
+ puts "Asset precompilation completed (#{"%.2f" % time}s)"
else
log "assets_precompile", :status => "failure"
puts "Precompiling assets failed, enabling runtime asset compilation"
@@ -496,8 +496,13 @@ def add_node_js_binary
def run_assets_precompile_rake_task
if rake_task_defined?("assets:precompile")
+ require 'benchmark'
+
topic "Running: rake assets:precompile"
- pipe("env PATH=$PATH:bin bundle exec rake assets:precompile 2>&1")
+ time = Benchmark.realtime { pipe("env PATH=$PATH:bin bundle exec rake assets:precompile 2>&1") }
+ if $?.success?
+ puts "Asset precompilation completed (#{"%.2f" % time}s)"
+ end
end
end
end

0 comments on commit 2893378

Please sign in to comment.