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

class PokerEmacs < EmacsFormula
  desc "Texas Hold'Em Poker for Emacs"
  homepage "https://elpa.gnu.org/packages/poker.html"
  url "https://elpa.gnu.org/packages/poker-0.2.el"
  sha256 "00b8a4953460c753e853dc093cf215ff836140de2fc41d3de4fbdb5de3d5336a"

  depends_on :emacs => "24.1"
  depends_on "homebrew/emacs/cl-lib" if Emacs.version < Version.create("24.3")

  def install
    mv "poker-#{version}.el", "poker.el"
    byte_compile "poker.el"
    elisp.install "poker.el", "poker.elc"
  end

  test do
    (testpath/"test.el").write <<-EOS.undent
      (add-to-list 'load-path "#{elisp}")
      (load "poker")
      (print (poker-random-deck))
    EOS
    assert_equal 52, shell_output("emacs -Q --batch -l #{testpath}/test.el").
      strip.gsub(/[()"]/, "").
      split(" ").length
  end
end
<commit_msg>poker-emacs: fix audit warnings<commit_after>require File.expand_path("../../Homebrew/emacs_formula", __FILE__)

class PokerEmacs < EmacsFormula
  desc "Texas Hold'Em Poker for Emacs"
  homepage "https://elpa.gnu.org/packages/poker.html"
  url "https://elpa.gnu.org/packages/poker-0.2.el"
  sha256 "00b8a4953460c753e853dc093cf215ff836140de2fc41d3de4fbdb5de3d5336a"

  depends_on :emacs => "24.1"
  depends_on "homebrew/emacs/cl-lib" if Emacs.version < Version.create("24.3")

  def install
    mv "poker-#{version}.el", "poker.el"
    byte_compile "poker.el"
    elisp.install "poker.el", "poker.elc"
  end

  test do
    (testpath/"test.el").write <<-EOS.undent
      (add-to-list 'load-path "#{elisp}")
      (load "poker")
      (print (poker-random-deck))
    EOS
    assert_equal 52, shell_output("emacs -Q --batch -l #{testpath}/test.el")
      .strip.gsub(/[()"]/, "")
      .split(" ").length
  end
end

{'fraction_non_alphanumeric': 0.16851441241685144, 'fraction_numerical': 0.057649667405764965, 'mean_word_length': 3.391727493917275, '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': '732122', 'n_tokens_mistral': 782, 'n_tokens_neox': 727, 'n_words': 125}