method

capture

capture(*argv, to:)
private

No documentation available.

# File activestorage/lib/active_storage/previewer.rb, line 71
      def capture(*argv, to))
        to.binmode

        open_tempfile do |err|
          IO.popen(argv, err: err) { |out| IO.copy_stream(out, to) }
          err.rewind

          unless $?.success?
            raise PreviewError, "#{argv.first} failed (status #{$?.exitstatus}): #{err.read.to_s.chomp}"
          end
        end

        to.rewind
      end