Use a tempfile instead of building our own.#4195
Conversation
This commit changes cache writing to use the Tempfile class rather than constructing our own tempfile. It means we don't have to deal with unlinking the tempfile in case there's an exception, and it also fixes this code on Ruby 2.5 (`Dir::Tmpname.make_tmpname` is no longer available)
lildude
left a comment
There was a problem hiding this comment.
LGTM. Thanks @tenderlove. Merge when ready. Lemme know when you want this on .com and I'll make a new release (tomorrow 🇬🇧 time at the earliest).
|
@lildude thank you! Whenever you have time. It isn't urgent, but I can't upgrade us to Ruby 2.5 without this. Thanks! |
|
Going to do a release now so we can see what the 2.5 PR looks like! |
|
Unfortunately this fails in some cases since we try to
We'll need to change this to drop it in the same directory like we were before. |
This commit changes cache writing to use the Tempfile class rather than
constructing our own tempfile. It means we don't have to deal with
unlinking the tempfile in case there's an exception, and it also fixes
this code on Ruby 2.5 (
Dir::Tmpname.make_tmpnameis no longeravailable)
Before this change:
After this change: