class ActiveStorage::Previewer

def open_tempfile

def open_tempfile
  tempfile = Tempfile.open("ActiveStorage-", tmpdir)
  begin
    yield tempfile
  ensure
    tempfile.close!
  end
end