Method: Cmds.chomp

Defined in:
lib/cmds/sugar.rb

.chomp(template, *args, **kwds, &input_block) ⇒ String

captures a new Cmds, captures and chomps stdout (sugar for Cmds.out(template, *args, **kwds, &input_block).chomp).

Parameters:

  • template (String)

    ERB template parameters are rendered into to create the command string.

  • *args (Array<Object>)

    positional parameters for rendering into the template.

  • **kwds (Hash{Symbol => Object})

    keyword parameters for rendering into the template.

  • &input_block (#call)

    optional block that returns a string or IO-like readable object to be used as input for the execution.

Returns:

  • (String)

    the command's chomped stdout.

See Also:



159
160
161
# File 'lib/cmds/sugar.rb', line 159

def self.chomp template, *args, **kwds, &input_block
  out(template, *args, **kwds, &input_block).chomp
end