Exception: Berkshelf::DependencyNotFound
- Inherits:
-
BerkshelfError
- Object
- StandardError
- BerkshelfError
- Berkshelf::DependencyNotFound
- Defined in:
- lib/berkshelf/errors.rb
Instance Method Summary collapse
-
#initialize(names) ⇒ DependencyNotFound
constructor
A new instance of DependencyNotFound.
- #to_s ⇒ Object (also: #message)
Methods inherited from BerkshelfError
Constructor Details
#initialize(names) ⇒ DependencyNotFound
Returns a new instance of DependencyNotFound.
197 198 199 |
# File 'lib/berkshelf/errors.rb', line 197 def initialize(names) @names = Array(names) end |
Instance Method Details
#to_s ⇒ Object Also known as: message
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/berkshelf/errors.rb', line 201 def to_s if @names.size == 1 "Dependency '#{@names.first}' was not found. Please make sure it is " \ "in your Berksfile, and then run `berks install` to download and " \ "install the missing dependencies." else out = "The following dependencies were not found:\n" @names.each do |name| out << " * #{name}\n" end out << "\n" out << "Please make sure they are in your Berksfile, and then run " out << "`berks install` to download and install the missing " out << "dependencies." out end end |