    # File lib/chef/cookbook/cookbook_version_loader.rb, line 46
          def load_cookbooks
            load_as(:attribute_filenames, 'attributes', '*.rb')
            load_as(:definition_filenames, 'definitions', '*.rb')
            load_as(:recipe_filenames, 'recipes', '*.rb')
            load_as(:library_filenames, 'libraries', '*.rb')
            load_recursively_as(:template_filenames, "templates", "*")
            load_recursively_as(:file_filenames, "files", "*")
            load_recursively_as(:resource_filenames, "resources", "*.rb")
            load_recursively_as(:provider_filenames, "providers", "*.rb")
            load_root_files

            remove_ignored_files

            if File.exists?(File.join(@cookbook_path, "metadata.rb"))
              @metadata_filenames << File.join(@cookbook_path, "metadata.rb")
            elsif File.exists?(File.join(@cookbook_path, "metadata.json"))
              @metadata_filenames << File.join(@cookbook_path, "metadata.json")
            end

            if empty?
              Chef::Log.warn "found a directory #{cookbook_name} in the cookbook path, but it contains no cookbook files. skipping."
            end
            @cookbook_settings
          end