Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8046 from pmahoney/exceptions_as_flow_control

Replace flow-control exception with explicit test.
  • Loading branch information...
commit 5bbe245a51cec029101c844e159ba7f7a7afedab 2 parents a273b6b + 8d0efcc
@rafaelfranca rafaelfranca authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 activesupport/lib/active_support/core_ext/file/atomic.rb
View
4 activesupport/lib/active_support/core_ext/file/atomic.rb
@@ -23,10 +23,10 @@ def self.atomic_write(file_name, temp_dir = Dir.tmpdir)
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))
Please sign in to comment.
Something went wrong with that request. Please try again.