instance method
writing
Ruby on Rails 6.1.7.10
Since v5.2.8.1 PrivateSignature
writing(contents)
No documentation comment.
Parameters
-
contentsreq
Source
# File activesupport/lib/active_support/encrypted_file.rb, line 71
def writing(contents)
Tempfile.create(["", "-" + content_path.basename.to_s.chomp(".enc")]) do |tmp_file|
tmp_path = Pathname.new(tmp_file)
tmp_path.binwrite contents
yield tmp_path
updated_contents = tmp_path.binread
write(updated_contents) if updated_contents != contents
end
end
Defined in activesupport/lib/active_support/encrypted_file.rb line 71
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::EncryptedFile