Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/berkshelf/core_ext/file.rb

Class Method Summary collapse

Class Method Details

.cookbook?(path) ⇒ Boolean Also known as: chef_cookbook?

Returns true or false if the given path contains a Chef Cookbook

Parameters:

  • path (#to_s)

    path of directory to reflect on

Returns:

  • (Boolean)

9
10
11
# File 'lib/berkshelf/core_ext/file.rb', line 9

def cookbook?(path)
  File.exists?(File.join(path, "metadata.json")) || File.exists?(File.join(path, "metadata.rb"))
end