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

class Js2Mode < EmacsFormula
  desc "Improved major mode for editing JavaScript in Emacs"
  homepage "https://github.com/mooz/js2-mode"
  head "https://github.com/mooz/js2-mode.git"

  stable do
    url "https://github.com/mooz/js2-mode/archive/20160623.tar.gz"
    sha256 "65e1321fdd042a105dd80318347beb41a68333cb2be0bbc44c4f3a21a21ffc16"

    # Prevent `make test` from loading old js2-mode from site-lisp;
    # remove in next release
    patch do
      url "https://github.com/mooz/js2-mode/commit/68db1f586eb2cd20a08e47aa7becdbee368ea22f.diff"
      sha256 "e4caccaa170e748519e8fd2471e68ed8a6e5449ea288eb6fdc1dca27721d17d3"
    end
  end

  depends_on :emacs => "24.1"

  def install
    system "make", "all"
    system "make", "test"
    elisp.install Dir["*.el"], Dir["*.elc"]
  end

  test do
    (testpath/"test.el").write <<-EOS.undent
      (add-to-list 'load-path "#{elisp}")
      (load "js2-mode")
      (print (minibuffer-prompt-width))
    EOS
    assert_equal "0", shell_output("emacs -Q --batch -l #{testpath}/test.el").strip
  end
end
<commit_msg>js2-mode 20170116<commit_after>require File.expand_path("../../Homebrew/emacs_formula", __FILE__)

class Js2Mode < EmacsFormula
  desc "Improved major mode for editing JavaScript in Emacs"
  homepage "https://github.com/mooz/js2-mode"
  url "https://github.com/mooz/js2-mode/archive/20170116.tar.gz"
  sha256 "ad18557494b4b251829dbc0b01a1976215799ddba04140475786797f122a9e67"
  head "https://github.com/mooz/js2-mode.git"

  depends_on :emacs => "24.1"

  def install
    system "make", "all"
    system "make", "test"
    elisp.install Dir["*.el"], Dir["*.elc"]
  end

  test do
    (testpath/"test.el").write <<-EOS.undent
      (add-to-list 'load-path "#{elisp}")
      (load "js2-mode")
      (print (minibuffer-prompt-width))
    EOS
    assert_equal "0", shell_output("emacs -Q --batch -l #{testpath}/test.el").strip
  end
end

{'fraction_non_alphanumeric': 0.14530776992936428, 'fraction_numerical': 0.09889001009081735, 'mean_word_length': 3.537757437070938, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 7, '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': '874329', 'n_tokens_mistral': 895, 'n_tokens_neox': 788, 'n_words': 142}