Class: RBatch::CmdResult
- Inherits:
-
Object
- Object
- RBatch::CmdResult
- Defined in:
- lib/rbatch/cmd.rb
Overview
Result of external command wrapper
Instance Attribute Summary (collapse)
-
- (String) cmd_str
readonly
Command string.
-
- (Integer) status
readonly
Exit status.
-
- (File) stderr_file
readonly
Tmp file including STDERROR String.
-
- (File) stdout_file
readonly
Tmp file including STDOUT String.
Instance Method Summary (collapse)
-
- (CmdResult) initialize(stdout_file, stderr_file, status, cmd_str)
constructor
A new instance of CmdResult.
-
- (String) stderr
STDERR String.
-
- (String) stdout
STDOUT String.
-
- (Hash) to_h
Return hash including cmd_str, std_out, std_err, and status.
-
- (String) to_s
Return string including cmd_str, std_out, std_err, and status.
Constructor Details
- (CmdResult) initialize(stdout_file, stderr_file, status, cmd_str)
Returns a new instance of CmdResult
94 95 96 97 98 99 |
# File 'lib/rbatch/cmd.rb', line 94 def initialize(stdout_file, stderr_file, status, cmd_str) @stdout_file = stdout_file @stderr_file = stderr_file @status = status @cmd_str = cmd_str end |
Instance Attribute Details
- (String) cmd_str (readonly)
Command string
91 92 93 |
# File 'lib/rbatch/cmd.rb', line 91 def cmd_str @cmd_str end |
- (Integer) status (readonly)
Exit status
87 88 89 |
# File 'lib/rbatch/cmd.rb', line 87 def status @status end |
- (File) stderr_file (readonly)
Tmp file including STDERROR String
83 84 85 |
# File 'lib/rbatch/cmd.rb', line 83 def stderr_file @stderr_file end |
- (File) stdout_file (readonly)
Tmp file including STDOUT String
79 80 81 |
# File 'lib/rbatch/cmd.rb', line 79 def stdout_file @stdout_file end |
Instance Method Details
- (String) stderr
STDERR String
109 110 111 |
# File 'lib/rbatch/cmd.rb', line 109 def stderr File.read(@stderr_file) end |
- (String) stdout
STDOUT String
103 104 105 |
# File 'lib/rbatch/cmd.rb', line 103 def stdout File.read(@stdout_file) end |
- (Hash) to_h
Return hash including cmd_str, std_out, std_err, and status
115 116 117 |
# File 'lib/rbatch/cmd.rb', line 115 def to_h {:cmd_str => @cmd_str,:stdout => stdout, :stderr => stderr, :status => status} end |
- (String) to_s
Return string including cmd_str, std_out, std_err, and status
121 122 123 |
# File 'lib/rbatch/cmd.rb', line 121 def to_s to_h.to_s end |