Exception: Clearbooks::DependencyNotFound

Inherits:
ClearbooksError show all
Defined in:
lib/clearbooks/error/errors.rb

Instance Method Summary collapse

Methods inherited from ClearbooksError

status_code

Constructor Details

#initialize(names) ⇒ DependencyNotFound

Returns a new instance of DependencyNotFound.

Parameters:



156
157
158
# File 'lib/clearbooks/error/errors.rb', line 156

def initialize(names)
  @names = Array(names)
end

Instance Method Details

#to_sObject



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