check for directory? in WeirdMethodLocator#valid_file? prevents crash under jruby