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-6.3.4 lib/berkshelf/core_ext/file.rb
berkshelf-6.3.3 lib/berkshelf/core_ext/file.rb
berkshelf-6.3.2 lib/berkshelf/core_ext/file.rb
berkshelf-6.3.1 lib/berkshelf/core_ext/file.rb
berkshelf-6.3.0 lib/berkshelf/core_ext/file.rb
berkshelf-6.2.2 lib/berkshelf/core_ext/file.rb
berkshelf-6.2.1 lib/berkshelf/core_ext/file.rb
berkshelf-6.2.0 lib/berkshelf/core_ext/file.rb
berkshelf-6.1.1 lib/berkshelf/core_ext/file.rb
berkshelf-6.1.0 lib/berkshelf/core_ext/file.rb
berkshelf-6.0.1 lib/berkshelf/core_ext/file.rb
berkshelf-6.0.0 lib/berkshelf/core_ext/file.rb
berkshelf-5.6.5 lib/berkshelf/core_ext/file.rb
berkshelf-5.6.4 lib/berkshelf/core_ext/file.rb
berkshelf-5.6.3 lib/berkshelf/core_ext/file.rb
berkshelf-5.6.2 lib/berkshelf/core_ext/file.rb
berkshelf-5.6.1 lib/berkshelf/core_ext/file.rb
berkshelf-5.6.0 lib/berkshelf/core_ext/file.rb
berkshelf-5.5.0 lib/berkshelf/core_ext/file.rb
berkshelf-5.4.0 lib/berkshelf/core_ext/file.rb