Created
November 17, 2010 21:44
-
-
Save rossta/704153 to your computer and use it in GitHub Desktop.
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
#! /usr/bin/env ruby | |
raise "Argument to 'take' not specfied.\n\n\tUsage: take [dump]\n" if ARGV.length == 0 | |
module Take | |
class BathroomClosedForCleaningError < RuntimeError; end | |
end | |
case ARGV[0].downcase | |
when 'dump' | |
remarks = [] | |
remarks << "You will not be able to 'take dump' at this time. We apologize for the inconvenience." | |
remarks << "Please light a match" | |
remarks << "That wing of the house is closed" | |
remarks << "Good lord. What died in here?" | |
require 'rubygems' | |
require 'rake' | |
attempt = rand(remarks.size) | |
raise Take::BathroomClosedForCleaningError.new, remarks[0] if attempt == 0 | |
system 'rake db:structure:dump db:test:prepare selenium:db:prepare' | |
puts "flushing...\n" | |
puts remarks[attempt] | |
else | |
puts "I don't know how to take '#{ARGV.join(' ')}'" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment