<commit_before>#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require "autotest"
require "git"

class AutotestGit < Autotest
  def git_update?
    git = Git.open(".")
    sha = git.object("HEAD").sha
    puts sha
    return false if sha == @sha
    @sha = sha
    true
  end

  def find_files_to_test files = find_files
    return nil unless git_update?
    super files
  end

  def self.runner
    style = options[:style] || AutotestGit.autodiscover
    target = AutotestGit

    unless style.empty? then
      mod = "autotest/#{style.join "_"}"
      puts "loading #{mod}"
      begin
        require mod
      rescue LoadError
        abort "AutotestGit style #{mod} doesn't seem to exist. Aborting."
      end
      target = AutotestGit.const_get(style.map {|s| s.capitalize}.join)
    end

    target
  end
end
<commit_msg>[from now] 2011年 3月20日 日曜日 13時05分43秒 JST<commit_after>#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require "autotest"
require "git"

class AutotestGit < Autotest
  def git_update?
    git = Git.open(".")
    sha = git.object("HEAD").sha
    puts sha

    return false if sha == @sha
    @sha = sha
    true
  end

  def find_files_to_test files = find_files
    return nil unless git_update?
    super files
  end

  def self.runner
    style = options[:style] || AutotestGit.autodiscover
    target = AutotestGit

    unless style.empty? then
      mod = "autotest/#{style.join "_"}"
      puts "loading #{mod}"
      begin
        require mod
      rescue LoadError
        abort "AutotestGit style #{mod} doesn't seem to exist. Aborting."
      end
      target = AutotestGit.const_get(style.map {|s| s.capitalize}.join)
    end

    target
  end
end

{'fraction_non_alphanumeric': 0.10727056019070322, 'fraction_numerical': 0.008939213349225268, 'mean_word_length': 2.497916666666667, 'pattern_counts': {'":': 0, '<': 5, '<?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': '467544', 'n_tokens_mistral': 603, 'n_tokens_neox': 570, 'n_words': 160}