Sha256: 7445b7cacdf67cb3ed900595a5328f2b8be1e2b244630e8eb1d7704afb78da7d

Contents?: true

Size: 388 Bytes

Versions: 62

Compression:

Stored size: 388 Bytes

Contents

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.exists?(File.join(path, "metadata.json")) || File.exists?(File.join(path, "metadata.rb"))
    end
    alias_method :chef_cookbook?, :cookbook?
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
berkshelf-2.0.14 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0.beta5 lib/berkshelf/core_ext/file.rb