<commit_before>
module Gitsy
  module Checks
    class Project

      def self.check?(config, project, write)
        return true if !config.project_check?

        cmd = File.join(File.expand_path(File.dirname(__FILE__)), "../../ext", config.project_check)
        cmd += " #{config.user} #{project}"
        cmd += " W" if write
        cmd += " R" if !write

        Kernel.system cmd
      end

    end
  end
end<commit_msg>The project check can now be an absolute path to a check script as well as a relative path to the ext directory.<commit_after>require 'pathname'

module Gitsy
  module Checks
    class Project

      def self.check?(config, project, write)
        return true if !config.project_check?

        cmd = config.project_check
        if !Pathname.new(config.project_check).absolute?
          cmd = File.join(
            File.expand_path(File.dirname(__FILE__)),
            "../../ext",
            config.project_check)
        end

        cmd += " #{config.user} #{project}"
        cmd += " W" if write
        cmd += " R" if !write

        Kernel.system cmd
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.1073345259391771, 'fraction_numerical': 0.0, 'mean_word_length': 2.0741758241758244, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1739281', 'n_tokens_mistral': 327, 'n_tokens_neox': 319, 'n_words': 100}