Method: CommandMapper::Command.capture

Defined in:
lib/command_mapper/command.rb

.capture(params = {}, **kwargs) {|command| ... } ⇒ String

Initializes and runs the command in a shell and captures all stdout output.

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    The option and argument values.

  • kwargs (Hash{Symbol => Object})

    Additional keywords arguments. These will be used to populate the command's params.

Yields:

  • (command)

    The newly initialized command.

Yield Parameters:

Returns:

  • (String)

    The stdout output of the command.



158
159
160
161
# File 'lib/command_mapper/command.rb', line 158

def self.capture(params={},**kwargs,&block)
  command = new(params,**kwargs,&block)
  command.capture_command
end