markbates (owner)

Revisions

gist: 193593 Download_button fork
public
Public Clone URL: git://gist.github.com/193593.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
def run_task(task, app=nil, use_sudo=false, extra_args='')
  apps = (app.nil? || app == :all) ? [:rtis, :mc, :pp] : [app]
  sudo = use_sudo ? 'sudo ' : ''
  apps.each do |app|
    res = Benchmark.realtime {
      sh "cd #{app} && #{sudo} rake #{task} #{ARGV.include?('--trace') ? '--trace' : ''} #{extra_args}"
    }
    puts "#{app} #{task} ran in #{res} seconds."
  end
end