Skip to content

Instantly share code, notes, and snippets.

@garciadanny
Forked from burtlo/Rakefile
Last active December 14, 2015 01:39
Show Gist options
  • Save garciadanny/5007958 to your computer and use it in GitHub Desktop.
Save garciadanny/5007958 to your computer and use it in GitHub Desktop.
# http://rake.rubyforge.org/
$:.push('lib')
require 'sales_engine'
def cleanup
puts "Cleaning Up My Mess"
end
task :environment do
puts "Loading Environment"
SalesEngine.startup
end
task :external do
puts "Loading External Environment"
end
namespace :test do
[ "third", "fourth"].each do |task_name|
desc "Running the #{task_name} task"
task task_name => [ :environment, :external ] do
puts "Running task #{task_name}"
cleanup
end
end
desc "Hey partner fix this for me while I go drink"
task "first" => :environment do
merchant = SalesEngine::Merchant.find_by_id(1)
puts merchant.name
cleanup
end
desc "Hey partner fix this for me while I go drink"
task "second" => [:environment, :external ] do
merchant = SalesEngine::Merchant.find_by_id(2)
puts merchant.name
cleanup
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment