Exception: Berkshelf::GitError
- Inherits:
-
BerkshelfError
- Object
- StandardError
- BerkshelfError
- Berkshelf::GitError
- Defined in:
- lib/berkshelf/errors.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#header ⇒ String
A common header for all git errors.
-
#initialize(stderr) ⇒ GitError
constructor
A new instance of GitError.
- #to_s ⇒ Object
Methods inherited from BerkshelfError
Constructor Details
#initialize(stderr) ⇒ GitError
Returns a new instance of GitError.
44 45 46 |
# File 'lib/berkshelf/errors.rb', line 44 def initialize(stderr) @stderr = stderr.to_s end |
Instance Method Details
#header ⇒ String
A common header for all git errors. The #to_s method should use this before outputting any specific errors.
52 53 54 |
# File 'lib/berkshelf/errors.rb', line 52 def header 'An error occurred during Git execution:' end |
#to_s ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/berkshelf/errors.rb', line 56 def to_s [ header, "", " " + @stderr.to_s.split("\n").map(&:strip).join("\n "), "" ].join("\n") end |