<commit_before>module Berkshelf::API
  module CacheBuilder
    # @author <NAME> <<EMAIL>>
    class Opscode < CacheBuilder::Base


      # @param [Hash] options The options for this
      # @option options [] :connection A connection object to use - This should probably only be set for testing
      def initialize(options={})
        super
        @connection = options[:connection] || 
          Berkshelf::API::SiteConnector::Opscode.pool
      end

      def archive_name
        "opscode-site"
      end

      def stale?
        true
      end

      def cookbooks
        all_cookbooks = connection.all_cookbooks
        slice = @options[:get_only] || all_cookbooks.size
        all_cookbooks = all_cookbooks.take(slice)
        all_cookbooks.map do |cookbook|
          versions = connection.all_versions(cookbook)
          versions.map { |version| RemoteCookbook.new(cookbook, version) }
        end.flatten
      end

      def metadata(remote)
        CookbookMetadata.new([], {})
      end

      private
        attr_accessor :connection
    end
  end
end<commit_msg>Use pool_link to link the SiteConnector pool to the PoolManager<commit_after>module Berkshelf::API
  module CacheBuilder
    # @author <NAME> <<EMAIL>>
    class Opscode < CacheBuilder::Base


      # @param [Hash] options The options for this
      # @option options [] :connection A connection object to use - This should probably only be set for testing
      def initialize(options={})
        super
        @connection = options[:connection] || 
          Berkshelf::API::SiteConnector::Opscode.pool_link
      end

      def archive_name
        "opscode-site"
      end

      def stale?
        true
      end

      def cookbooks
        all_cookbooks = connection.all_cookbooks
        slice = @options[:get_only] || all_cookbooks.size
        all_cookbooks = all_cookbooks.take(slice)
        all_cookbooks.map do |cookbook|
          versions = connection.all_versions(cookbook)
          versions.map { |version| RemoteCookbook.new(cookbook, version) }
        end.flatten
      end

      def metadata(remote)
        CookbookMetadata.new([], {})
      end

      private
        attr_accessor :connection
    end
  end
end
{'fraction_non_alphanumeric': 0.08201892744479496, 'fraction_numerical': 0.0, 'mean_word_length': 2.3636363636363638, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5514925', 'n_tokens_mistral': 626, 'n_tokens_neox': 606, 'n_words': 164}