javan/whenever — pull request #251 by cap10morgan (2012-09-13 15:49:36+00:00)
Title: fix file not found error when running under JRuby

Tempfile deletes the file it creates after it's closed (for various definitions of "after"). It appears that this happens much sooner under JRuby (1.6.7.2) than under MRI. This was causing a race condition where running crontab /tmp/tempfile would often fail because JRuby had already unlinked the tempfile.

This pull request refactors the tempfile code to ensure that the file still exists when the crontab command is run, but still cleans it up before exiting.