Skip to content

Instantly share code, notes, and snippets.

@rossta
Created November 17, 2010 21:44
Show Gist options
  • Save rossta/704153 to your computer and use it in GitHub Desktop.
Save rossta/704153 to your computer and use it in GitHub Desktop.
#! /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