diff options
author | George Claghorn <george@basecamp.com> | 2019-03-28 18:47:42 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2019-03-28 18:47:42 -0400 |
commit | 562f3a2d21de52872ccd9a2c8b734e30ec63430b (patch) | |
tree | 54b75b83739e9efa3d19a0f88ed3b1f5193fe367 /activestorage/lib/active_storage/previewer.rb | |
parent | e3f5f1c936869b81b01835adc9c683e058edfeaf (diff) | |
download | rails-562f3a2d21de52872ccd9a2c8b734e30ec63430b.tar.gz rails-562f3a2d21de52872ccd9a2c8b734e30ec63430b.tar.bz2 rails-562f3a2d21de52872ccd9a2c8b734e30ec63430b.zip |
Add ActiveStorage::Service#open
Diffstat (limited to 'activestorage/lib/active_storage/previewer.rb')
-rw-r--r-- | activestorage/lib/active_storage/previewer.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activestorage/lib/active_storage/previewer.rb b/activestorage/lib/active_storage/previewer.rb index 95a041fd16..af6bcadd4c 100644 --- a/activestorage/lib/active_storage/previewer.rb +++ b/activestorage/lib/active_storage/previewer.rb @@ -26,7 +26,7 @@ module ActiveStorage 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. @@ -42,7 +42,7 @@ module ActiveStorage # 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 @@ -54,7 +54,7 @@ module ActiveStorage end def open_tempfile - tempfile = Tempfile.open("ActiveStorage-", tempdir) + tempfile = Tempfile.open("ActiveStorage-", tmpdir) begin yield tempfile @@ -77,7 +77,7 @@ module ActiveStorage ActiveStorage.logger end - def tempdir #:doc: + def tmpdir #:doc: Dir.tmpdir end end |