Exception: Clearbooks::DependencyNotFound
- Inherits:
-
ClearbooksError
- Object
- StandardError
- ClearbooksError
- Clearbooks::DependencyNotFound
- Defined in:
- lib/clearbooks/error/errors.rb
Instance Method Summary collapse
-
#initialize(names) ⇒ DependencyNotFound
constructor
A new instance of DependencyNotFound.
- #to_s ⇒ Object
Methods inherited from ClearbooksError
Constructor Details
#initialize(names) ⇒ DependencyNotFound
Returns a new instance of DependencyNotFound.
156 157 158 |
# File 'lib/clearbooks/error/errors.rb', line 156 def initialize(names) @names = Array(names) end |
Instance Method Details
#to_s ⇒ Object
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/clearbooks/error/errors.rb', line 160 def to_s if @names.size == 1 "Dependency '#{@names.first}' was not found. Please make sure it is " \ "in your Clearbooksfile, 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 Clearbooksfile, and then run " out << "`berks install` to download and install the missing " out << "dependencies." out end end |