method

capture

Importance_0
v7.1.3.4 - Show latest stable - 0 notes - Class: Previewer
capture(*argv, to:) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activestorage/lib/active_storage/previewer.rb, line 78
      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
Register or log in to add new notes.