Class: CommandLineScript
- Inherits:
-
Object
- Object
- CommandLineScript
- Includes:
- LoggerUtil
- Defined in:
- lib/jenkins_util/command_line_script.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#exit_status ⇒ Object
readonly
Returns the value of attribute exit_status.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#stdin ⇒ Object
readonly
Returns the value of attribute stdin.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
-
#sterr ⇒ Object
readonly
Returns the value of attribute sterr.
Instance Method Summary collapse
-
#initialize(command) ⇒ CommandLineScript
constructor
A new instance of CommandLineScript.
Methods included from LoggerUtil
Constructor Details
#initialize(command) ⇒ CommandLineScript
Returns a new instance of CommandLineScript.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/jenkins_util/command_line_script.rb', line 9 def initialize(command) @command = command LoggerUtil.log.debug("Executing: \"#{@command}\"") status = Open4.popen4(@command) do |pid, stdin, stdout, stderr| @pid = pid @stdin = stdin @stdout = stdout.readlines @error = stderr.readlines end @exit_status = status.exitstatus end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
7 8 9 |
# File 'lib/jenkins_util/command_line_script.rb', line 7 def command @command end |
#exit_status ⇒ Object (readonly)
Returns the value of attribute exit_status.
7 8 9 |
# File 'lib/jenkins_util/command_line_script.rb', line 7 def exit_status @exit_status end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
7 8 9 |
# File 'lib/jenkins_util/command_line_script.rb', line 7 def pid @pid end |
#stdin ⇒ Object (readonly)
Returns the value of attribute stdin.
7 8 9 |
# File 'lib/jenkins_util/command_line_script.rb', line 7 def stdin @stdin end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
7 8 9 |
# File 'lib/jenkins_util/command_line_script.rb', line 7 def stdout @stdout end |
#sterr ⇒ Object (readonly)
Returns the value of attribute sterr.
7 8 9 |
# File 'lib/jenkins_util/command_line_script.rb', line 7 def sterr @sterr end |