Skip to content

Instantly share code, notes, and snippets.

@heftig
Created November 30, 2011 10:51
Show Gist options
  • Save heftig/1408650 to your computer and use it in GitHub Desktop.
Save heftig/1408650 to your computer and use it in GitHub Desktop.
BEGIN {
require "fileutils"
FileUtils.touch("run.old")
$stdout = $stderr = open("run","w")
}
END {
system("diff -u run.old run")
FileUtils.mv("run", "run.old", :force => true)
}
puts rand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment