lib/vimgolf/challenge.rb in vimgolf-0.4.7 vs lib/vimgolf/challenge.rb in vimgolf-0.4.8
- old
+ new
@@ -22,12 +22,16 @@
end
def work_files
@vimrc_path = File.expand_path('../vimgolf.vimrc', __FILE__)
- # keep these temp files around so they don't close
+ # keep these Tempfile's around so they don't unlink
@work = Tempfile.new(['vimgolf', ".#{@type}"])
@log = Tempfile.new('golflog')
+ # close tmp files, but don't unlink
+ @work.close
+ @log.close
+
@work_path = @work.path()
@log_path = @log.path()
end
def download