Replace Dir.exist? to File.exist? for ruby-1.8.7 compatibility