Sha256: 087f2b6a5529fbcc03868a3cec47b2ca0e5fa6a42ff91e2b6d87e607b369babf
Contents?: true
Size: 709 Bytes
Versions: 9
Compression:
Stored size: 709 Bytes
Contents
# frozen-string-literal: true require "down/version" require "down/chunked_io" require "down/errors" require "down/utils" require "fileutils" module Down class Backend def self.download(*args, **options, &block) new.download(*args, **options, &block) end def self.open(*args, **options, &block) new.open(*args, **options, &block) end private # If destination path is defined, move tempfile to the destination, # otherwise return the tempfile unchanged. def download_result(tempfile, destination) return tempfile unless destination tempfile.close # required for Windows FileUtils.mv tempfile.path, destination nil end end end
Version data entries
9 entries across 9 versions & 2 rubygems