RiotGames/berkshelf

View on GitHub
lib/berkshelf/core_ext/file.rb

Summary

Maintainability
A
0 mins
Test Coverage
class File
  class << self
    # Returns true or false if the given path contains a Chef Cookbook
    #
    # @param [#to_s] path
    #   path of directory to reflect on
    #
    # @return [Boolean]
    def cookbook?(path)
      File.exist?(File.join(path, "metadata.json")) || File.exist?(File.join(path, "metadata.rb"))
    end
    alias_method :chef_cookbook?, :cookbook?
  end
end