faded picture of luke
a semi-random photo | click for the full photo gallery
click to browse photos
homepage navigation

Luke Melia

Tracks 1.5 is out

We released Tracks 1.5 today. Tracks is the open source Rails app for implementing the Getting Things Done system. I contributed heavily to this app in the too-long time since the last stable release. Big kudos and thanks go to Reinier Balt in the Netherlands, who contributed some great statistical visualizations and generally ran the project the past few months while bsag and I have been busy with out professional commitments.

Anyway, lots of great changes since 1.043. Check it out and let us know what you think.

capistrano task autocompletion for bash

Remembering all those capistrano tasks can be tough for the sleep-impaired startup employee…. Help yourself out with this autocomplete script:

#!/usr/bin/env ruby

# Save this somewhere, chmod 755 it, then add
#   complete -C path/to/this/script -o default cap
# to your ~/.bashrc
# If you update your tasks, just $ rm ~/.captabs*

exit 0 unless /^cap\b/ =~ ENV["COMP_LINE"]

def cap_silent_tasks
  if File.exists?(dotcache = File.join(File.expand_path('~'), ".captabs-#{Dir.pwd.hash}"))
    tasks = `cap -qT`
    tasks = tasks.select{|task| task =~ /^cap/ }.join
    File.open(dotcache, 'w') { |f| f.puts tasks }

after_match = $'
task_match = (after_match.empty? || after_match =~ /\s$/) ? nil : after_match.split.last
tasks = cap_silent_tasks.split("\n")[1..-1].map { |line| line.split[1] }
tasks = tasks.select { |t| /^#{Regexp.escape task_match}/ =~ t } if task_match

# handle namespaces
if task_match =~ /^([-\w:]+:)/
  upto_last_colon = $1
  after_match = $'
  tasks = tasks.map { |t| (t =~ /^#{Regexp.escape upto_last_colon}([-\w:]+)$/) ? "#{$1}" : t }

puts tasks
exit 0
LukeMelia.com created 1999. ··· Luke Melia created 1976. ··· Live With Passion!
Luke Melia on software development freelance web development how to contact me Luke Melia, Software Developer letters and more from my travels photo gallery personal philosophy