Created
April 9, 2013 16:15
-
-
Save mattsnyder/5347069 to your computer and use it in GitHub Desktop.
Sample shell for a rake task with namespacing and benchmarking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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