replace Dir.exists? w/ File.directory? for Ruby 1.8.7 compat