Use Pathname#find since Pathname#detect does not exist

Fixes regression introduced by #4f92c13e1f8.
Merge pull request #107 from strzibny/fix-pathname-detect

Use Pathname#find since Pathname#detect does not exist