1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #8046 from pmahoney/exceptions_as_flow_control

Replace flow-control exception with explicit test.
This commit is contained in:
Rafael Mendonça França 2012-10-28 13:22:45 -07:00
commit 5bbe245a51

View file

@ -23,10 +23,10 @@ class File
yield temp_file
temp_file.close
begin
if File.exists?(file_name)
# Get original file permissions
old_stat = stat(file_name)
rescue Errno::ENOENT
else
# If not possible, probe which are the default permissions in the
# destination directory.
old_stat = probe_stat_in(dirname(file_name))