<commit_before>$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__))

# original code by <NAME>:
# http://aviewfromafar.net/2007/11/1/rake-task-for-heckling-your-specs

begin
  require 'pathname'
  require 'backports'
  require 'active_support/inflector'
  require 'heckle'
  require 'mspec'
  require 'mspec/utils/name_map'

  SKIP_METHODS = %w[ blank_slate_method_added ].freeze

  class NameMap
    def file_name(method, constant)
      map  = MAP[method]
      name = if map
        map[constant] || map[:default]
      else
        method.
          gsub('?','_ques').
          gsub('!','_bang').
          gsub('=','_assign')
      end
      "#{name}_spec.rb"
    end
  end

  desc 'Heckle each module and class'
  task :heckle => :rcov do
    unless Ruby2Ruby::VERSION == '1.2.2'
      raise "ruby2ruby version #{Ruby2Ruby::VERSION} may not work properly, 1.2.2 *only* is recommended for use with heckle"
    end

    require 'adamantium'

    root_module_regexp = Regexp.union('Adamantium')

    spec_dir = Pathname('spec/unit')
<commit_msg>Fix heckle to reference the coverage task, not rcov<commit_after>$LOAD_PATH.unshift(File.expand_path('../../../lib', __FILE__))

# original code by <NAME>:
# http://aviewfromafar.net/2007/11/1/rake-task-for-heckling-your-specs

begin
  require 'pathname'
  require 'backports'
  require 'active_support/inflector'
  require 'heckle'
  require 'mspec'
  require 'mspec/utils/name_map'

  SKIP_METHODS = %w[ blank_slate_method_added ].freeze

  class NameMap
    def file_name(method, constant)
      map  = MAP[method]
      name = if map
        map[constant] || map[:default]
      else
        method.
          gsub('?','_ques').
          gsub('!','_bang').
          gsub('=','_assign')
      end
      "#{name}_spec.rb"
    end
  end

  desc 'Heckle each module and class'
  task :heckle => :coverage do
    unless Ruby2Ruby::VERSION == '1.2.2'
      raise "ruby2ruby version #{Ruby2Ruby::VERSION} may not work properly, 1.2.2 *only* is recommended for use with heckle"
    end

    require 'adamantium'

    root_module_regexp = Regexp.union('Adamantium')

    spec_dir = Pathname('spec/unit')

{'fraction_non_alphanumeric': 0.13657407407407407, 'fraction_numerical': 0.014814814814814815, 'mean_word_length': 2.950639853747715, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4791801', 'n_tokens_mistral': 791, 'n_tokens_neox': 751, 'n_words': 170}