<commit_before>require 'jar_dependencies'
require 'jars/gemspec_artifacts'

module Jars
  class MavenFactory

    module AttachJars

      def attach_jars( spec, all_dependencies = false )
        @index ||= 0
        @done ||= []

        deps = GemspecArtifacts.new( spec )
        deps.artifacts.each do |a|
          # for this gemspec we want to include all artifacts but
          # for all others we want to exclude provided and test artifacts
          if !@done.include?( a.key ) and (all_dependencies or (a.scope != 'provided' and a.scope != 'test'))

            # ruby dsl is not working reliably for classifier
            self[ "jars.#{@index}" ] = a.to_coord_no_classifier
            if a.exclusions
              jndex = 0
              a.exclusions.each do |ex|
                self[ "jars.#{@index}.exclusions.#{jndex}" ] = ex.to_s
              end
            end
            self[ "jars.#{@index}.scope" ] = a.scope if a.scope
            if a.classifier
              self[ "jars.#{@index}.classifier" ] = a.classifier
            end
            @index += 1
            @done << a.key
          end
        end
      end
    end

    attr_reader :debug, :verbose

    def initialize( options = nil,  debug = Jars.debug?, verbose = Jars.verbose? )
      @options = (options || {}).dup
      @options.delete( :ignore_dependencies )
      @debug = debug
      @verbose = verbose
      @installed_maven = false<commit_msg>Fix multi exclusions<commit_after>require 'jar_dependencies'
require 'jars/gemspec_artifacts'

module Jars
  class MavenFactory

    module AttachJars

      def attach_jars( spec, all_dependencies = false )
        @index ||= 0
        @done ||= []

        deps = GemspecArtifacts.new( spec )
        deps.artifacts.each do |a|
          # for this gemspec we want to include all artifacts but
          # for all others we want to exclude provided and test artifacts
          if !@done.include?( a.key ) and (all_dependencies or (a.scope != 'provided' and a.scope != 'test'))

            # ruby dsl is not working reliably for classifier
            self[ "jars.#{@index}" ] = a.to_coord_no_classifier
            if a.exclusions
              jndex = 0
              a.exclusions.each do |ex|
                self[ "jars.#{@index}.exclusions.#{jndex}" ] = ex.to_s
                jndex += 1
              end
            end
            self[ "jars.#{@index}.scope" ] = a.scope if a.scope
            if a.classifier
              self[ "jars.#{@index}.classifier" ] = a.classifier
            end
            @index += 1
            @done << a.key
          end
        end
      end
    end

    attr_reader :debug, :verbose

    def initialize( options = nil,  debug = Jars.debug?, verbose = Jars.verbose? )
      @options = (options || {}).dup
      @options.delete( :ignore_dependencies )
      @debug = debug
      @verbose = verbose
      @installed_maven = false
{'fraction_non_alphanumeric': 0.10623714873200822, 'fraction_numerical': 0.002398903358464702, 'mean_word_length': 1.7959770114942528, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '5799224', 'n_tokens_mistral': 901, 'n_tokens_neox': 853, 'n_words': 243}