lib/active_storage/previewer.rb in activestorage-6.0.0.beta3 vs lib/active_storage/previewer.rb in activestorage-6.0.0.rc1
- old
+ new
@@ -24,11 +24,11 @@
end
private
# Downloads the blob to a tempfile on disk. Yields the tempfile.
def download_blob_to_tempfile(&block) #:doc:
- blob.open tempdir: tempdir, &block
+ blob.open tmpdir: tmpdir, &block
end
# Executes a system command, capturing its binary output in a tempfile. Yields the tempfile.
#
# Use this method to shell out to a system library (e.g. muPDF or FFmpeg) for preview image
@@ -40,11 +40,11 @@
# yield io: output, filename: "#{blob.filename.base}.png", content_type: "image/png"
# end
# end
# end
#
- # The output tempfile is opened in the directory returned by #tempdir.
+ # The output tempfile is opened in the directory returned by #tmpdir.
def draw(*argv) #:doc:
open_tempfile do |file|
instrument :preview, key: blob.key do
capture(*argv, to: file)
end
@@ -52,11 +52,11 @@
yield file
end
end
def open_tempfile
- tempfile = Tempfile.open("ActiveStorage-", tempdir)
+ tempfile = Tempfile.open("ActiveStorage-", tmpdir)
begin
yield tempfile
ensure
tempfile.close!
@@ -75,10 +75,10 @@
def logger #:doc:
ActiveStorage.logger
end
- def tempdir #:doc:
+ def tmpdir #:doc:
Dir.tmpdir
end
end
end