Skip to content

Instantly share code, notes, and snippets.

@angelbotto
Created April 21, 2014 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelbotto/11157638 to your computer and use it in GitHub Desktop.
Save angelbotto/11157638 to your computer and use it in GitHub Desktop.
ejecute task in controllers, for more speed
def call_rake(task, options = {})
options[:padrino_env] ||= Padrino.env
args = options.map { |name,value| "#{name.to_s.upcase}='#{value}'" }
system "rake #{task} #{args.join(' ')} --trace 2>&1 >> #{Padrino.root}/log/rake.log &"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment