Class: PuppetX::Cups::Shell::ShellOut

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

Overview

Wrapper class for command line executions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, stdin) ⇒ ShellOut


16
17
18
19
20
21
22
23
# File 'lib/puppet_x/cups/shell.rb', line 16

def initialize(command, stdin)
  @command = command
  @stdin = stdin

  @stdout, @stderr, process_status = Open3.capture3(command, stdin_data: stdin)

  @exitcode = process_status.exitstatus
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command


14
15
16
# File 'lib/puppet_x/cups/shell.rb', line 14

def command
  @command
end

#exitcodeObject (readonly)

Returns the value of attribute exitcode


14
15
16
# File 'lib/puppet_x/cups/shell.rb', line 14

def exitcode
  @exitcode
end

#stderrObject (readonly)

Returns the value of attribute stderr


14
15
16
# File 'lib/puppet_x/cups/shell.rb', line 14

def stderr
  @stderr
end

#stdinObject (readonly)

Returns the value of attribute stdin


14
15
16
# File 'lib/puppet_x/cups/shell.rb', line 14

def stdin
  @stdin
end

#stdoutObject (readonly)

Returns the value of attribute stdout


14
15
16
# File 'lib/puppet_x/cups/shell.rb', line 14

def stdout
  @stdout
end