lib/io_streams/utils.rb in iostreams-1.6.2 vs lib/io_streams/utils.rb in iostreams-1.7.0

- old
+ new

@@ -26,14 +26,12 @@ # # File is deleted upon completion if present. def self.temp_file_name(basename, extension = "") result = nil ::Dir::Tmpname.create([basename, extension], IOStreams.temp_dir, max_try: MAX_TEMP_FILE_NAME_ATTEMPTS) do |tmpname| - begin - result = yield(tmpname) - ensure - ::File.unlink(tmpname) if ::File.exist?(tmpname) - end + result = yield(tmpname) + ensure + ::File.unlink(tmpname) if ::File.exist?(tmpname) end result end class URI