fix: use don't use methods that require new ruby version

This is a regression from ea24af10. Dir.exists isn't available in ruby 1.8
Merge pull request #68 from theuni/cache

fix: use don't use methods that require new ruby version