<commit_before>module AccessLint
  class Runner
    RUNNER_PATH = File.expand_path("../../../vendor/access-lint/bin/auditor.js", __FILE__)
    attr_reader :output

    def initialize(target)
      @target = target
    end

    def run
      @output = `phantomjs #{RUNNER_PATH} #{@target}`
      return if audit_success?

      if !phantomjs_installed?
        raise AccessLint::RunnerError.new("Please install PhantomJS. Visit http://phantomjs.org/ for instructions.")
      else
        raise AccessLint::RunnerError.new("PhantomJS exited without success: #{@output}")
      end
    end

    private

    def audit_success?
      $?.success?
    end

    def phantomjs_installed?
      $?.exitstatus != 127
    end
  end
end<commit_msg>signal exceptions using "fail" rather than "raise".<commit_after>module AccessLint
  class Runner
    RUNNER_PATH = File.expand_path("../../../vendor/access-lint/bin/auditor.js", __FILE__)
    attr_reader :output

    def initialize(target)
      @target = target
    end

    def run
      @output = `phantomjs #{RUNNER_PATH} #{@target}`
      return if audit_success?

      if !phantomjs_installed?
        fail AccessLint::RunnerError.new("Please install PhantomJS. Visit http://phantomjs.org/ for instructions.")
      else
        fail AccessLint::RunnerError.new("PhantomJS exited without success: #{@output}")
      end
    end

    private

    def audit_success?
      $?.success?
    end

    def phantomjs_installed?
      $?.exitstatus != 127
    end
  end
end
{'fraction_non_alphanumeric': 0.10927152317880795, 'fraction_numerical': 0.003973509933774834, 'mean_word_length': 2.7034313725490198, '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': '1173969', 'n_tokens_mistral': 479, 'n_tokens_neox': 442, 'n_words': 113}