Method: File.write

Defined in:
lib/extension.rb

.write(path, string, *options) ⇒ Object



20
21
22
23
24
25
# File 'lib/extension.rb', line 20

def File.write(path, string, *options)
  dirname = File.dirname(path)
  temp_path = File.join(dirname, SecureRandom.hex(15))
  super(temp_path, string, *options)
  File.rename(temp_path, path)
end