Skip to content

Instantly share code, notes, and snippets.

@kstevens715
Created August 26, 2020 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kstevens715/224663a3d784261cf3d4da4b91c0ddf5 to your computer and use it in GitHub Desktop.
Save kstevens715/224663a3d784261cf3d4da4b91c0ddf5 to your computer and use it in GitHub Desktop.
require 'tempfile'
t = Tempfile.new
t.write('data')
t.close # comment out to see difference
if File.open(t.path).read == 'data'
puts 'Tempfile was complete'
else
puts 'Tempfile missing data'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment