Reputation: 13
Example: a - community cookbook, b - wrapper cookbook
a/libraries/default.rb:
module Path
def path
'/var/'
end
def other_method; end
...
end
This module included in a-cookbook resource. a/resources/default.rb:
include Path
...
a = path
b = other_method
...
I want to override path method in wrapper cookbook with:
b/libraries/default.rb:
module Path
def path
'/usr/'
end
end
Upvotes: 1
Views: 507
Reputation: 54211
Yes, code in libraries/
is just run as-is so all the normal Ruby rules about monkey patching apply.
Upvotes: 1