Library method monkeypatch


#1

Hello all.

I’m new in Chef and have a newbie question.

Can i monkeypatch method from a cookbook library in my wrapped cookbook?

For example:
a - community cookbook
b - wrapped cookbook

a/libraries/default.rb:

module Path
  def path
    '/var/'
  end

  def other_method; end
end

I want to override path method with:
b/libraries/default.rb:

module Path
  def path
    '/usr/'
  end
end

#2

Figured out, not relevant anymore