Class: Scriptster::ShellCmd
- Inherits:
-
Object
- Object
- Scriptster::ShellCmd
- Includes:
- Logger
- Defined in:
- lib/scriptster/shellcmd.rb
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_file, set_script_name, set_time, set_verbosity, #tag
Constructor Details
#initialize(cmd, opts = {}) ⇒ ShellCmd
Returns a new instance of ShellCmd.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/scriptster/shellcmd.rb', line 34 def initialize(cmd, opts={}) @out = "" @err = "" @show_out = false @show_err = true @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.
30 31 32 |
# File 'lib/scriptster/shellcmd.rb', line 30 def err @err end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
30 31 32 |
# File 'lib/scriptster/shellcmd.rb', line 30 def out @out end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
30 31 32 |
# File 'lib/scriptster/shellcmd.rb', line 30 def status @status end |