Exception: Fox::DependencyNotFound

Inherits:
FoxError
  • Object
show all
Defined in:
lib/fox/error/errors.rb

Instance Method Summary collapse

Methods inherited from FoxError

status_code

Constructor Details

#initialize(names) ⇒ DependencyNotFound

Returns a new instance of DependencyNotFound.

Parameters:

  • names (String, Array<String>)

    the list of cookbook names that were not defined



155
156
157
# File 'lib/fox/error/errors.rb', line 155

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

Instance Method Details

#to_sObject



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/fox/error/errors.rb', line 159

def to_s
  if @names.size == 1
    "Dependency '#{@names.first}' was not found. Please make sure it is " \
    "in your Foxfile, and then run `fox 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 Foxfile, and then run "
    out << "`fox install` to download and install the missing "
    out << "dependencies."
    out
  end
end