fix FTBFS, replace Dir.exist by File.directory for old ruby versions