<commit_before>require 'pathname'

# Public: A Class containing all the metadata and utilities needed to manage a
# ruby project.
class ThisProject
  # The name of this project
  attr_accessor :name

  # The author's name
  attr_accessor :author

  # The email address of the author(s)
  attr_accessor :email

  # The homepage of this project
  attr_accessor :homepage 

  # The regex of files to exclude from the manifest
  attr_accessor :exclude_from_manifest

  # The hash of Gem::Specifications keyed' by platform
  attr_accessor :gemspecs

  # Public: Initialize ThisProject
  #
  # Yields self
  def initialize(&block)
    @exclude_from_manifest = %r/\.(git|DS_Store)|^(doc|coverage|pkg|tmp|Gemfile(\.lock)?)|^[^\/]+\.gemspec|\.(swp|jar|bundle|so|rvmrc)$|~$/
    @gemspecs              = Hash.new
    yield self if block_given?
  end

  # Public: return the version of ThisProject
  #
  # Search the ruby files in the project looking for the one that has the
  # version string in it. This does not eval any code in the project, it parses
  # the source code looking for the string.<commit_msg>convert to Regexp.union<commit_after>require 'pathname'

# Public: A Class containing all the metadata and utilities needed to manage a
# ruby project.
class ThisProject
  # The name of this project
  attr_accessor :name

  # The author's name
  attr_accessor :author

  # The email address of the author(s)
  attr_accessor :email

  # The homepage of this project
  attr_accessor :homepage 

  # The regex of files to exclude from the manifest
  attr_accessor :exclude_from_manifest

  # The hash of Gem::Specifications keyed' by platform
  attr_accessor :gemspecs

  # Public: Initialize ThisProject
  #
  # Yields self
  def initialize(&block)
    @exclude_from_manifest = Regexp.union(/\.(git|DS_Store)/,
                                          /^(doc|coverage|pkg|tmp|Gemfile(\.lock)?)/,
                                          /^[^\/]+\.gemspec/,
                                          /\.(swp|jar|bundle|so|rvmrc|travis.yml)$/,
                                          /~$/)
    @gemspecs              = Hash.new
    yield self if block_given?
  end

  # Public: return the version of ThisProject
  #
  # Search the ruby files in the project looking for the one that has the
  # version string in it. This does not eval any code in the project, it parses
  # the source code looking for the string.
{'fraction_non_alphanumeric': 0.08246995441359303, 'fraction_numerical': 0.0, 'mean_word_length': 2.6798780487804876, 'pattern_counts': {'":': 0, '<': 3, '<?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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1299826', 'n_tokens_mistral': 727, 'n_tokens_neox': 686, 'n_words': 252}