class Pathname

def cookbook?

Returns:
  • (Boolean) -
def cookbook?
  join("metadata.json").exist? || join("metadata.rb").exist?
end

def cookbook_root

Returns:
  • (Pathname, nil) -
def cookbook_root
  ascend do |potential_root|
    if potential_root.cookbook?
      return potential_root
    end
  end
end