Flowdock
method

writing

Importance_0
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: Secrets
writing(contents) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/rails/secrets.rb, line 90
        def writing(contents)
          file_name = "#{File.basename(path)}.#{Process.pid}"

          Tempfile.create(["", "-" + file_name]) 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
Register or log in to add new notes.