Class: R10K::Util::Subprocess::Result Private

Inherits:
Object
  • Object
show all
Defined in:
lib/r10k/util/subprocess/result.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv, stdout, stderr, exit_code) ⇒ Result

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Result.



24
25
26
27
28
29
30
# File 'lib/r10k/util/subprocess/result.rb', line 24

def initialize(argv, stdout, stderr, exit_code)
  @argv = argv
  @cmd = argv.join(' ')
  @stdout = stdout
  @stderr = stderr
  @exit_code = exit_code
end

Instance Attribute Details

#argvObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



6
7
8
# File 'lib/r10k/util/subprocess/result.rb', line 6

def argv
  @argv
end

#cmdObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
# File 'lib/r10k/util/subprocess/result.rb', line 10

def cmd
  @cmd
end

#exit_codeObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
# File 'lib/r10k/util/subprocess/result.rb', line 22

def exit_code
  @exit_code
end

#stderrObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
# File 'lib/r10k/util/subprocess/result.rb', line 18

def stderr
  @stderr
end

#stdoutObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
# File 'lib/r10k/util/subprocess/result.rb', line 14

def stdout
  @stdout
end

Instance Method Details

#[](field) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
# File 'lib/r10k/util/subprocess/result.rb', line 32

def [](field)
  send(field)
end

#failed?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


36
37
38
# File 'lib/r10k/util/subprocess/result.rb', line 36

def failed?
  exit_code != 0
end

#success?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


40
41
42
# File 'lib/r10k/util/subprocess/result.rb', line 40

def success?
  exit_code == 0
end