Class: DDSL::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/ddsl/shell.rb

Defined Under Namespace

Classes: ExitStatusError

Instance Method Summary collapse

Instance Method Details

#call!(argv) ⇒ void

This method returns an undefined value.

Run given list of arguments in a shell.

Note: $stdin, $stout and $stderr will be forwarded

Parameters:

  • argv (Array<String>)

Raises:



18
19
20
# File 'lib/ddsl/shell.rb', line 18

def call!(argv)
  raise ExitStatusError unless invoke(argv)
end

#invoke(argv) ⇒ Bool

Invoke given argument list in a subshell

Parameters:

  • argv (Array<String>)

Returns:

  • (Bool)

    true if exit status of the program is 0, no otherwise



29
30
31
32
33
# File 'lib/ddsl/shell.rb', line 29

def invoke(argv)
  system(
    argv.join(' ')
  )
end