    # File lib/chef/cookbook_loader.rb, line 61
        def load_cookbooks
          cookbook_settings = Hash.new
          @repo_paths.each do |repo_path|
            repo_path = File.expand_path(repo_path)
            chefignore = Cookbook::Chefignore.new(repo_path)
            Dir[File.join(repo_path, "*")].each do |cookbook_path|
              next unless File.directory?(cookbook_path)
              loader = Cookbook::CookbookVersionLoader.new(cookbook_path, chefignore)
              loader.load_cookbooks
              next if loader.empty?
              @cookbooks_paths[loader.cookbook_name] << cookbook_path # for deprecation warnings
              if @loaded_cookbooks.key?(loader.cookbook_name)
                @merged_cookbooks << loader.cookbook_name # for deprecation warnings
                @loaded_cookbooks[loader.cookbook_name].merge!(loader)
              else
                @loaded_cookbooks[loader.cookbook_name] = loader
              end
            end
          end

          @loaded_cookbooks.each do |cookbook, loader|
            cookbook_version = loader.cookbook_version
            @cookbooks_by_name[cookbook] = cookbook_version
            @metadata[cookbook] = cookbook_version.metadata
          end
          @cookbooks_by_name
        end