Exception: Sprinkle::Errors::PrettyFailure

Inherits:
StandardError
  • Object
show all
Defined in:
lib/sprinkle/errors/pretty_failure.rb

Overview

:nodoc:

Direct Known Subclasses

RemoteCommandFailure, TransferFailure

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(installer, details = {}, previous_error = nil) ⇒ PrettyFailure

Returns a new instance of PrettyFailure



8
9
10
11
12
# File 'lib/sprinkle/errors/pretty_failure.rb', line 8

def initialize(installer, details={}, previous_error=nil)
  @installer = installer
  @details = details
  @previous_error = previous_error
end

Instance Attribute Details

#detailsObject

Returns the value of attribute details



6
7
8
# File 'lib/sprinkle/errors/pretty_failure.rb', line 6

def details
  @details
end

Instance Method Details

#boxed(s) ⇒ Object



21
22
23
24
25
26
# File 'lib/sprinkle/errors/pretty_failure.rb', line 21

def boxed(s)
  puts red("-"*54)
  puts red("| #{s.center(50)} |")
  puts red("-"*54)
  puts
end

#log(s, o) ⇒ Object



14
15
16
17
18
19
# File 'lib/sprinkle/errors/pretty_failure.rb', line 14

def log(s, o)
  puts s
  puts "-" * (s.length+2)
  puts o
  puts
end