Class: Dr::ShellCmd
Instance Attribute Summary collapse
-
#err ⇒ Object
readonly
Returns the value of attribute err.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(cmd, opts = {}) ⇒ ShellCmd
constructor
A new instance of ShellCmd.
Methods included from Logger
#log, log, set_logfile, set_verbosity, #tag
Constructor Details
#initialize(cmd, opts = {}) ⇒ ShellCmd
Returns a new instance of ShellCmd.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/dr/shellcmd.rb', line 15 def initialize(cmd, opts={}) @out = "" @show_out = false @raise_on_error = true @tag = "shell" @expect = 0 opts.each do |k, v| self.instance_variable_set("@#{k.to_s}", v) end @cmd = cmd @status = nil run end |
Instance Attribute Details
#err ⇒ Object (readonly)
Returns the value of attribute err.
11 12 13 |
# File 'lib/dr/shellcmd.rb', line 11 def err @err end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
11 12 13 |
# File 'lib/dr/shellcmd.rb', line 11 def out @out end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
11 12 13 |
# File 'lib/dr/shellcmd.rb', line 11 def status @status end |