Improve file search in Ruby