Instead of piping into other processes, can you do this in Ruby? For example:

```ruby
`zsh --version` =~ /zsh (\d)/
$1.to_i == 5
```

You also don't need a separate `which 'zsh'` - there isn't an OS X without zsh preinstalled as far as I know. Certainly `/bin/zsh` exists as far back as Tiger.