<commit_before>require File.expand_path("../../Homebrew/emacs_formula", __FILE__)

class AgEmacs < EmacsFormula
  desc "Emacs front-end to ag (the silver searcher)"
  homepage "http://agel.readthedocs.org/en/latest/"
  url "https://github.com/Wilfred/ag.el/archive/0.46.tar.gz"
  sha256 "27d55776b47968bbccf0548d63bc91ef91390322842ab1f95db6c107d862df93"
  head "https://github.com/Wilfred/ag.el.git"

  depends_on :emacs => "23.4"
  depends_on "the_silver_searcher"
  depends_on "homebrew/emacs/dash-emacs"
  depends_on "homebrew/emacs/s-emacs"
  depends_on "homebrew/emacs/cl-lib" if Emacs.version < 24.3

  def install
    byte_compile "ag.el"
    elisp.install "ag.el", "ag.elc"
  end

  test do
    (testpath/"test.el").write <<-EOS.undent
      (add-to-list 'load-path "#{elisp}")
      (add-to-list 'load-path "#{Formula["homebrew/emacs/dash-emacs"].opt_elisp}")
      (add-to-list 'load-path "#{Formula["homebrew/emacs/s-emacs"].opt_elisp}")
      (load "ag")
      (print (buffer-name (ag "#{elisp}" "#{testpath}")))<commit_msg>ag-emacs 0.47<commit_after>require File.expand_path("../../Homebrew/emacs_formula", __FILE__)

class AgEmacs < EmacsFormula
  desc "Emacs front-end to ag (the silver searcher)"
  homepage "http://agel.readthedocs.org/en/latest/"
  url "https://github.com/Wilfred/ag.el/archive/0.47.tar.gz"
  sha256 "5951a28a112a7adeb2276d12bb9543e5ea4a42ca27fcd50c7a0e436fb9b995e6"
  head "https://github.com/Wilfred/ag.el.git"

  depends_on :emacs => "23.4"
  depends_on "the_silver_searcher"
  depends_on "homebrew/emacs/dash-emacs"
  depends_on "homebrew/emacs/s-emacs"
  depends_on "homebrew/emacs/cl-lib" if Emacs.version < 24.3

  def install
    byte_compile "ag.el"
    elisp.install "ag.el", "ag.elc"
  end

  test do
    (testpath/"test.el").write <<-EOS.undent
      (add-to-list 'load-path "#{elisp}")
      (add-to-list 'load-path "#{Formula["homebrew/emacs/dash-emacs"].opt_elisp}")
      (add-to-list 'load-path "#{Formula["homebrew/emacs/s-emacs"].opt_elisp}")
      (load "ag")
      (print (buffer-name (ag "#{elisp}" "#{testpath}")))
{'fraction_non_alphanumeric': 0.17084942084942084, 'fraction_numerical': 0.052123552123552123, 'mean_word_length': 3.8661971830985915, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '6157229', 'n_tokens_mistral': 915, 'n_tokens_neox': 865, 'n_words': 128}