Sha256: 1ebeaddcca49ceb0c0b45cdd6fe12d6fd66fb6382e965ff1e7fb68df53689f3a

Contents?: true

Size: 332 Bytes

Versions: 17

Compression:

Stored size: 332 Bytes

Contents

class File
  class << self
    # Returns true or false if the given path is a Chef Cookbook
    #
    # @param [#to_s] path
    #   path of directory to reflect on
    #
    # @return [Boolean]
    def cookbook?(path)
      File.exists?(File.join(path, 'metadata.rb'))
    end
    alias_method :chef_cookbook?, :cookbook?
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
berkshelf-2.0.13 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.12 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.11 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0.beta4 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0.beta3 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.10 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.9 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.8 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0.beta2 lib/berkshelf/core_ext/file.rb
berkshelf-3.0.0.beta1 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.7 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.6 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.5 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.4 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.3 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.1 lib/berkshelf/core_ext/file.rb
berkshelf-2.0.0 lib/berkshelf/core_ext/file.rb