Fix calls to Tempfile.new (GH issue #792)

Suffix of "*.rb" caused temp files to be named with "*.rb"
at the end, literally.  Not all file systems like that, and
it's almost certainly not what was intended.
Merge pull request #796 from L2G/gh-792

Fix calls to Tempfile.new (GH issue #792)