Replace File.exists? with File.exist?

File.exists? is deprecated in Ruby 2.1
Don't rescue from Exception
Prefer "&&" to "and"
Hash#has_key? is deprecated in favor of Hash#key?
Correct inconsistent indentation
Parentheses around conditions and definitions