Class: ProcessExecuter::Options::RunWithCaptureOptions
- Inherits:
-
RunOptions
- Object
- Base
- SpawnOptions
- SpawnWithTimeoutOptions
- RunOptions
- ProcessExecuter::Options::RunWithCaptureOptions
- Defined in:
- lib/process_executer/options/run_with_capture_options.rb
Overview
Define options for ProcessExecuter.run_with_capture
Constant Summary collapse
- DEFAULT_ENCODING =
The default encoding used for stdout and stderr if no other encoding is specified.
Encoding::UTF_8
Constants inherited from SpawnOptions
Instance Method Summary collapse
-
#effective_stderr_encoding ⇒ Encoding?
private
Determines the character encoding to use for stderr.
-
#effective_stdout_encoding ⇒ Encoding?
private
Determines the character encoding to use for stdout.
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_encoding ⇒ Encoding?
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.
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_encoding ⇒ Encoding?
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.
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 |