Exception: MotherBrain::PluginNotFound

Inherits:
MBError
  • Object
show all
Defined in:
lib/mb/errors.rb

Constant Summary

Constants inherited from MBError

MBError::DEFAULT_EXIT_CODE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MBError

#error_code, error_code, exit_code, #exit_code, #to_hash, #to_json, #to_s

Constructor Details

#initialize(name, version = nil) ⇒ PluginNotFound

Returns a new instance of PluginNotFound.



262
263
264
265
# File 'lib/mb/errors.rb', line 262

def initialize(name, version = nil)
  @name    = name
  @version = version
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



259
260
261
# File 'lib/mb/errors.rb', line 259

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



260
261
262
# File 'lib/mb/errors.rb', line 260

def version
  @version
end

Instance Method Details

#messageObject



267
268
269
270
271
# File 'lib/mb/errors.rb', line 267

def message
  msg = "No plugin named '#{name}'"
  msg << " of version (#{version})" unless version.nil?
  msg << " found"
end