Installing Ruby 1.9 on Mac OS X 10.5
Tommie over at The blog with no name has written up a how-to on getting Ruby 1.9 up and running in Mac OS X 10.5.7.
Check it out: http://www.tommycampbell.net/2009/06/26/ruby-1-9-on-mac-os-x
module Kernel
def desire(library)
require library
return true
rescue LoadError
STDERR.puts "warning: #{library} gem desired but not found."
return false
end
end
And here's how I optionally include the metric_fu gem.
desire 'metric_fu'If a user has the gem installed, rake -T will show the tasks.
jasonn:~/sources/my_files [master] $ rake -T (in ~/sources/my_files) rake metrics:all [...] jasonn:~/sources/my_files [master] $If the user does not have the gem installed, rake -T will show a simple warning and continue.
jasonn:~/sources/my_files [master] $ rake -T (in ~/sources/my_files) warning: metric_fu gem desired but not found. [...] jasonn:~/sources/my_files [master] $I don't remember where I first heard the desire idea, but it works pretty well.
git diff --diff-filter=D --name-only HEAD@{'7 days ago'} | \
grep -v ^doc | perl -ne 'chomp;
print "git show e2ae03f14ce81a3e24ec6cbe2e73767f4c6fed1b -- $_ > $_\n";' | sh
This restored all the files I deleted that did not start with doc.
These files show up as diff files, so you may have to remove the "- " at the beginning of the lines and commit messages. But hey, it's better than not having the files you need.