class ProcessExecuter::Options::RunOptions

Define options for {ProcessExecuter.run}

@api public

Private Instance Methods

define_options() click to toggle source

The options allowed for objects of this class @return [Array<OptionDefinition>] @api private

Calls superclass method
# File lib/process_executer/options/run_options.rb, line 18
def define_options
  [
    *super,
    OptionDefinition.new(:raise_errors, default: true, validator: method(:validate_raise_errors)),
    OptionDefinition.new(:logger, default: Logger.new(nil), validator: method(:validate_logger))
  ].freeze
end
validate_logger(_key, _value) click to toggle source

Note an error if the logger option is not valid @param _key [Symbol] the option key (not used) @param _value [Object] the option value (not used) @return [Void] @api private

# File lib/process_executer/options/run_options.rb, line 42
def validate_logger(_key, _value)
  return if logger.respond_to?(:info) && logger.respond_to?(:debug)

  errors << "logger must respond to #info and #debug but was #{logger.inspect}"
end
validate_raise_errors(_key, _value) click to toggle source

Note an error if raise_errors is not true or false @param _key [Symbol] the option key (not used) @param _value [Object] the option value (not used) @return [Void] @api private

# File lib/process_executer/options/run_options.rb, line 31
def validate_raise_errors(_key, _value)
  return if [true, false].include?(raise_errors)

  errors << "raise_errors must be true or false but was #{raise_errors.inspect}"
end