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.



245
246
247
248
# File 'lib/mb/errors.rb', line 245

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



242
243
244
# File 'lib/mb/errors.rb', line 242

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



243
244
245
# File 'lib/mb/errors.rb', line 243

def version
  @version
end

Instance Method Details

#messageObject



250
251
252
253
254
# File 'lib/mb/errors.rb', line 250

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