Skip to content

Instantly share code, notes, and snippets.

@ryangreenberg
ryangreenberg / todo.rb
Created March 26, 2012 23:03
todo_for_real
require 'date'
class ExpiredTodoError < StandardError; end
# Implementation #
def todo(what, by_date)
if production? || (Date.parse(by_date) >= Date.today)
yield
else
raise ExpiredTodoError, "TODO: #{what}"