Skip to content

Instantly share code, notes, and snippets.

@stujo
Created October 2, 2014 16:03
Show Gist options
  • Save stujo/5cced674f6320963b08e to your computer and use it in GitHub Desktop.
Save stujo/5cced674f6320963b08e to your computer and use it in GitHub Desktop.
Todo Helper Rakefile
desc 'Generate a migration timestamp'
task 'mtimestamp' do
puts Time.now.strftime("%Y%m%d%H%M%S")
end
desc 'Test Drive Code'
task "driver" do
puts "ADD #{`ruby todo.rb add Bake a delicious blueberry-glazed cheesecake`}"
puts "LIST #{`ruby todo.rb list`}"
# Get the last ID
id = Task.last.id
if id > 0
complete_results = `ruby todo.rb complete #{id}`
puts "COMPLETE #{complete_results}"
delete_results = `ruby todo.rb delete #{id}`
puts "DELETE #{delete_results}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment