For reference, the Bash equivalents are discussed here: Check if a program exists from a Bash script
I've been doing something like
if `which commandname` =~ /commandname/
# do stuff
end
but I'm wondering if there is something a little cleaner.