    # File lib/chef/cookbook_loader.rb, line 45
        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?
              if @loaded_cookbooks.key?(loader.cookbook_name)
                @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