Exception: VerboseShell::ShellError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- VerboseShell::ShellError
- Defined in:
- lib/verbose-shell.rb
Instance Attribute Summary collapse
-
#cmd ⇒ Object
Returns the value of attribute cmd.
-
#exit_code ⇒ Object
Returns the value of attribute exit_code.
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(output, cmd, exit_code) ⇒ ShellError
constructor
A new instance of ShellError.
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(output, cmd, exit_code) ⇒ ShellError
Returns a new instance of ShellError.
18 19 20 21 22 |
# File 'lib/verbose-shell.rb', line 18 def initialize(output, cmd, exit_code) @output = output @cmd = cmd @exit_code = exit_code end |
Instance Attribute Details
#cmd ⇒ Object
Returns the value of attribute cmd.
17 18 19 |
# File 'lib/verbose-shell.rb', line 17 def cmd @cmd end |
#exit_code ⇒ Object
Returns the value of attribute exit_code.
17 18 19 |
# File 'lib/verbose-shell.rb', line 17 def exit_code @exit_code end |
#output ⇒ Object
Returns the value of attribute output.
17 18 19 |
# File 'lib/verbose-shell.rb', line 17 def output @output end |
Instance Method Details
#message ⇒ Object
24 25 26 |
# File 'lib/verbose-shell.rb', line 24 def "\n\n"+(['']*20+@output.split("\n"))[-20..-1].join("\n").lstrip + "\n"+Pastel.new.bright_white.on_red("💩 Command \"#{@cmd[0]}\" returned #{@exit_code}") end |
#to_s ⇒ Object
27 |
# File 'lib/verbose-shell.rb', line 27 def to_s; ; end |