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-3.2.2 lib/berkshelf/core_ext/file.rb
berkshelf-3.2.1 lib/berkshelf/core_ext/file.rb
berkshelf-3.2.0 lib/berkshelf/core_ext/file.rb
berkshelf-3.1.5 lib/berkshelf/core_ext/file.rb
berkshelf-3.1.4 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.18 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.17 lib/berkshelf/core_ext/file.rb
berkshelf-3.1.3 lib/berkshelf/core_ext/file.rb
berkshelf-3.1.2 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.16 lib/berkshelf/core_ext/file.rb
berkshelf-3.1.1 lib/berkshelf/core_ext/file.rb
berkshelf-3.1.0 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.1 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.15 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0.rc1 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0.beta9 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0.beta8 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0.beta7 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0.beta6 lib/berkshelf/core_ext/file.rb