Class: ProcessExecuter::Options::RunWithCaptureOptions

Inherits:
RunOptions show all
Defined in:
lib/process_executer/options/run_with_capture_options.rb

Overview

Constant Summary collapse

DEFAULT_ENCODING =

The default encoding used for stdout and stderr if no other encoding is specified.

Returns:

  • (Encoding)
Encoding::UTF_8

Constants inherited from SpawnOptions

SpawnOptions::SPAWN_OPTIONS

Instance Method Summary collapse

Methods inherited from SpawnOptions

#combined_stdout_and_stderr_redirection?, #redirection?, #spawn_options, #std_redirection?, #stderr_redirection?, #stderr_redirection_destination, #stderr_redirection_source, #stdout_redirection?, #stdout_redirection_destination, #stdout_redirection_source

Methods inherited from Base

#allowed_options, #each_with_object, #initialize, #inspect, #merge, #merge!, #to_h, #to_s

Constructor Details

This class inherits a constructor from ProcessExecuter::Options::Base

Instance Method Details

#effective_stderr_encodingEncoding?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Determines the character encoding to use for stderr

It prioritizes stderr_encoding if set, otherwise falls back to encoding, and finally defaults to DEFAULT_ENCODING if neither is available.

The value is canonicalized to an Encoding object, so equivalent representations (e.g. Encoding::UTF_8, 'UTF-8', or :binary for Encoding::BINARY) all resolve to the same Encoding.

Returns:

  • (Encoding, nil)

    nil if the value names an unknown encoding



52
53
54
# File 'lib/process_executer/options/run_with_capture_options.rb', line 52

def effective_stderr_encoding
  canonical_encoding(stderr_encoding || encoding || DEFAULT_ENCODING)
end

#effective_stdout_encodingEncoding?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Determines the character encoding to use for stdout

It prioritizes stdout_encoding if set, otherwise falls back to encoding, and finally defaults to DEFAULT_ENCODING if neither is available.

The value is canonicalized to an Encoding object, so equivalent representations (e.g. Encoding::UTF_8, 'UTF-8', or :binary for Encoding::BINARY) all resolve to the same Encoding.

Returns:

  • (Encoding, nil)

    nil if the value names an unknown encoding



34
35
36
# File 'lib/process_executer/options/run_with_capture_options.rb', line 34

def effective_stdout_encoding
  canonical_encoding(stdout_encoding || encoding || DEFAULT_ENCODING)
end