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

#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.

Returns:

  • (Encoding)


44
45
46
# File 'lib/process_executer/options/run_with_capture_options.rb', line 44

def effective_stderr_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.

Returns:

  • (Encoding)


30
31
32
# File 'lib/process_executer/options/run_with_capture_options.rb', line 30

def effective_stdout_encoding
  stdout_encoding || encoding || DEFAULT_ENCODING
end