<commit_before>
require 'pathname'

module Gemgem
  class << self
    attr_accessor :dir, :spec
  end

  module_function
  def create
    yield(spec = Gem::Specification.new{ |s|
      s.authors     = ['<NAME> (godfat)']
      s.email       = ['godfat (XD) godfat.org']
      s.homepage    = "http://github.com/godfat/#{s.name}"

      s.summary     = File.read("#{Gemgem.dir}/README").
                      match(/DESCRIPTION:\n\n(.+?)\n\n/m)[1]
      s.description = s.summary

      s.extra_rdoc_files = %w[CHANGES CONTRIBUTORS LICENSE TODO]
      s.rdoc_options     = %w[--main README]
      s.rubygems_version = Gem::VERSION
      s.date             = Time.now.strftime('%Y-%m-%d')
      s.files            = gem_files
      s.test_files       = gem_files.grep(%r{^test/(.+?/)*test_.+?\.rb$})
      s.require_paths    = %w[lib]
    })
    spec
  end

  def gem_tag
    "#{spec.name}-#{spec.version}"
  end

  def write
    File.open("#{dir}/#{spec.name}.gemspec", 'w'){ |f| f << spec.to_ruby }
  end

  def all_files
    @all_files ||= find_files(Pathname.new(dir)).map{ |file|
      if file.to_s =~ %r{\.git/}
        nil
      else
        file.to_s
      end<commit_msg>gemgem.rb: no contributor file at the moment<commit_after>
require 'pathname'

module Gemgem
  class << self
    attr_accessor :dir, :spec
  end

  module_function
  def create
    yield(spec = Gem::Specification.new{ |s|
      s.authors     = ['<NAME> (godfat)']
      s.email       = ['godfat (XD) godfat.org']
      s.homepage    = "http://github.com/godfat/#{s.name}"

      s.summary     = File.read("#{Gemgem.dir}/README").
                      match(/DESCRIPTION:\n\n(.+?)\n\n/m)[1]
      s.description = s.summary

      s.extra_rdoc_files = %w[CHANGES LICENSE TODO]
      s.rdoc_options     = %w[--main README]
      s.rubygems_version = Gem::VERSION
      s.date             = Time.now.strftime('%Y-%m-%d')
      s.files            = gem_files
      s.test_files       = gem_files.grep(%r{^test/(.+?/)*test_.+?\.rb$})
      s.require_paths    = %w[lib]
    })
    spec
  end

  def gem_tag
    "#{spec.name}-#{spec.version}"
  end

  def write
    File.open("#{dir}/#{spec.name}.gemspec", 'w'){ |f| f << spec.to_ruby }
  end

  def all_files
    @all_files ||= find_files(Pathname.new(dir)).map{ |file|
      if file.to_s =~ %r{\.git/}
        nil
      else
        file.to_s
      end
{'fraction_non_alphanumeric': 0.17087542087542087, 'fraction_numerical': 0.0008417508417508417, 'mean_word_length': 2.0280254777070064, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, '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': '1494120', 'n_tokens_mistral': 918, 'n_tokens_neox': 887, 'n_words': 154}