Skip to content

Instantly share code, notes, and snippets.

@mattsnyder
Created April 9, 2013 16:15
Show Gist options
  • Save mattsnyder/5347069 to your computer and use it in GitHub Desktop.
Save mattsnyder/5347069 to your computer and use it in GitHub Desktop.
Sample shell for a rake task with namespacing and benchmarking
namespace :b2b2dot0 do
namespace :magento do
desc "Imports some stuff from one place to another"
task :import_stuff => :environment do
benchmark = Benchmark.measure do
# The import stuff here
SomeStuff.import do |stuff|
stuff.do_something_more
end
end.real
puts "(task completed in %.2f seconds)" % t
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment