<commit_before>require "language/node"

class Coffeescript < Formula
  desc "Unfancy JavaScript"
  homepage "http://coffeescript.org"
  url "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.5.tgz"
  sha256 "caa67ae9689b58a7005760fb869d7b4e7c6b785e5f6934c3eee8673669a75394"
  head "https://github.com/jashkenas/coffeescript.git", :branch => "2"

  bottle do
    cellar :any_skip_relocation
    sha256 "bfb5cb719d9eb5bac426edf8ae2b3ed08da898c80b6c43c83be0d510edf4ed83" => :sierra
    sha256 "22c5f53e1790a73f34fea0f2bb7c094796b031ff33dcf6a7c897a27bf9b44af8" => :el_capitan
    sha256 "b1940f95c27a23782fc443b82b88539574adb6a6584974212941755432ff4e48" => :yosemite
  end

  devel do
    url "https://registry.npmjs.org/coffeescript/-/coffeescript-2.0.0-alpha1.tgz"
    sha256 "6de0bb53bf3c98fab8151af7c4e2bb5a258f276d7bee1d5374b7a038557c39df"
  end

  depends_on "node"

  def install
    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
    bin.install_symlink Dir["#{libexec}/bin/*"]
  end

  test do
    (testpath/"test.coffee").write <<-EOS.undent
      square = (x) -> x * x
      list = [1, 2, 3, 4, 5]

      math =
        root:   Math.sqrt
        square: square<commit_msg>coffeescript 2.0.0-beta1 (devel) (#12511)<commit_after>require "language/node"

class Coffeescript < Formula
  desc "Unfancy JavaScript"
  homepage "http://coffeescript.org"
  url "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.5.tgz"
  sha256 "caa67ae9689b58a7005760fb869d7b4e7c6b785e5f6934c3eee8673669a75394"
  head "https://github.com/jashkenas/coffeescript.git", :branch => "2"

  bottle do
    cellar :any_skip_relocation
    sha256 "bfb5cb719d9eb5bac426edf8ae2b3ed08da898c80b6c43c83be0d510edf4ed83" => :sierra
    sha256 "22c5f53e1790a73f34fea0f2bb7c094796b031ff33dcf6a7c897a27bf9b44af8" => :el_capitan
    sha256 "b1940f95c27a23782fc443b82b88539574adb6a6584974212941755432ff4e48" => :yosemite
  end

  devel do
    url "https://registry.npmjs.org/coffeescript/-/coffeescript-2.0.0-beta1.tgz"
    sha256 "9976d3f9594209bcfbedfe290abcc3a8ec8767f698425cfd2bc1419a6e5589a7"
  end

  depends_on "node"

  def install
    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
    bin.install_symlink Dir["#{libexec}/bin/*"]
  end

  test do
    (testpath/"test.coffee").write <<-EOS.undent
      square = (x) -> x * x
      list = [1, 2, 3, 4, 5]

      math =
        root:   Math.sqrt
        square: square
{'fraction_non_alphanumeric': 0.11396011396011396, 'fraction_numerical': 0.18844118844118843, 'mean_word_length': 4.240938166311301, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 6, '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': '6503017', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1078, 'n_words': 140}