Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Created August 11, 2010 18:05
Show Gist options
  • Save ryanflorence/519420 to your computer and use it in GitHub Desktop.
Save ryanflorence/519420 to your computer and use it in GitHub Desktop.
CLI + TextMate todo list management
#!/usr/bin/env ruby
# place or symlink this script somewhere in your path and then
#
# $ todo category long description of task
#
# todo script creates a new file and opens it up in textmate
# take back your task manager, geeks!
Dir.chdir('/path/to/todo/directory/')
category = ARGV.shift
title = ARGV.join(' ')
filename = "#{category}/#{title}.todo"
doc = "---
title: #{title}
category: #{category}
created_at: #{Time.now}
---
"
Dir.mkdir(category) unless File.exists?(category)
File.open(filename, 'w') {|f| f.write(doc) }
`mate "#{filename}"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment