Exception: CookbookOmnifetch::MismatchedCookbookName
- Inherits:
-
OmnifetchError
- Object
- StandardError
- OmnifetchError
- CookbookOmnifetch::MismatchedCookbookName
- Defined in:
- lib/cookbook-omnifetch/exceptions.rb
Instance Method Summary collapse
-
#initialize(dependency, cached_cookbook) ⇒ MismatchedCookbookName
constructor
A new instance of MismatchedCookbookName.
- #to_s ⇒ Object
Methods inherited from OmnifetchError
Constructor Details
#initialize(dependency, cached_cookbook) ⇒ MismatchedCookbookName
Returns a new instance of MismatchedCookbookName.
87 88 89 90 91 |
# File 'lib/cookbook-omnifetch/exceptions.rb', line 87 def initialize(dependency, cached_cookbook) @dependency = dependency @cached_cookbook = cached_cookbook super(to_s) end |
Instance Method Details
#to_s ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/cookbook-omnifetch/exceptions.rb', line 93 def to_s out = "In your Berksfile, you have:\n" out << "\n" out << " cookbook '#{@dependency.name}'\n" out << "\n" out << "But that cookbook is actually named '#{@cached_cookbook.cookbook_name}'\n" out << "\n" out << "This can cause potentially unwanted side-effects in the future.\n" out << "\n" out << "NOTE: If you do not explicitly set the 'name' attribute in the " out << "metadata, the name of the directory will be used instead. This " out << "is often a cause of confusion for dependency solving.\n" out end |