<commit_before># encoding: utf-8

require 'yaml'

Gem::Specification.new do |gemspec|
  scm = if File.directory?('.git')
          :git
        end

  files = case scm
          when :git
            `git ls-files -z`.split("\0")
          else
            Dir.glob('{**/}{.*,*}').select { |path| File.file?(path) }
          end

  defaults = {
    :bin_files => 'bin/*',
    :files => 'lib/{**/}*.rb',
    :test_files => '{test/{**/}*_test.rb,spec/{**/}*_spec.rb}',
    :extra_doc_files => '*.{txt,rdoc,md,markdown,tt,textile}',
    :version_path => File.join('lib','scm','version.rb')
  }

  expand_files = lambda { |pattern|
    case pattern
    when Array
      pattern
    when String
      Dir.glob(pattern).select { |path|
        File.file?(path) && files.include?(path)
      }
    end
  }

  metadata = YAML.load_file('gemspec.yml')

  gemspec.name = if metadata['name']
                   metadata['name']
                 else
                   File.basename(File.dirname(__FILE__))
                 end

  gemspec.version = if metadata['version']
                      metadata['version']
                    elsif files.include?('VERSION')
                      File.read('VERSION').chomp
                    elsif files.include?(defaults[:version_path])
                      Kernel.load(defaults[:version_path])

                      SCM::VERSION
                    end

  gemspec.summary = metadata.fetch('summary',metadata['description'])
  gemspec.description = metadata.fetch('description',metadata['summary'])
  gemspec.licenses = metadata['license']

  gemspec.authors = metadata['authors']
  gemspec.email = metadata['email']
  gemspec.homepage = metadata['homepage']

  case metadata['require_paths']
  when Array<commit_msg>Updated the boilerplate gemspec again.<commit_after># encoding: utf-8

require 'yaml'

Gem::Specification.new do |gemspec|
  defaults = {
    :bin_files => 'bin/*',
    :files => 'lib/{**/}*.rb',
    :test_files => '{test/{**/}*_test.rb,spec/{**/}*_spec.rb}',
    :extra_doc_files => '*.{txt,rdoc,md,markdown,tt,textile}',
    :version => {
      :file => 'lib/scm/version.rb',
      :constant => 'SCM::VERSION'
    }
  }

  scm = if File.directory?('.git')
          :git
        end

  files = case scm
          when :git
            `git ls-files -z`.split("\0")
          else
            Dir.glob('{**/}{.*,*}').select { |path| File.file?(path) }
          end

  expand_files = lambda { |pattern|
    case pattern
    when Array
      pattern
    when String
      Dir.glob(pattern).select { |path|
        File.file?(path) && files.include?(path)
      }
    end
  }

  metadata = YAML.load_file('gemspec.yml')

  gemspec.name = if metadata['name']
                   metadata['name']
                 else
                   File.basename(File.dirname(__FILE__))
                 end

  gemspec.version = if metadata['version']
                      metadata['version']
                    elsif files.include?('VERSION')
                      File.read('VERSION').chomp
                    elsif files.include?(defaults[:version][:file])
                      require File.join('.',defaults[:version][:file])
                      eval(defaults[:version][:constant])
                    end

  gemspec.summary = metadata.fetch('summary',metadata['description'])
  gemspec.description = metadata.fetch('description',metadata['summary'])
  gemspec.licenses = metadata['license']

  gemspec.authors = metadata['authors']
  gemspec.email = metadata['email']
  gemspec.homepage = metadata['homepage']

  case metadata['require_paths']
  when Array
{'fraction_non_alphanumeric': 0.15839112343966713, 'fraction_numerical': 0.0011095700416088765, 'mean_word_length': 2.11130284728214, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2698027', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1050, 'n_words': 185}