<commit_before>class Jsonnet < Formula
  desc "Domain specific configuration language for defining JSON data."
  homepage "https://google.github.io/jsonnet/doc/"
  url "https://github.com/google/jsonnet/archive/v0.8.7.tar.gz"
  sha256 "c1cc21fcc8b6d590bc13af05e5932b07ec0e00c1a9737a01f858a7aefca52ffb"

  bottle do
    cellar :any_skip_relocation
    sha256 "de8636d5e2c72b12302d0b580cc523dd69d42515df6b7e989d3f7d70bf12c626" => :el_capitan
    sha256 "a4f3f40594c54f87347348f1398610f1e7755f1328345572d259bd7d3a0564db" => :yosemite
    sha256 "d873d720f899167b86bb62aa7ef77c148e7daca45d16ecefc9b42e7a5b9185c4" => :mavericks
  end

  needs :cxx11

  depends_on :macos => :mavericks

  def install
    ENV.cxx11
    system "make"
    bin.install "jsonnet"
  end

  test do
    require "utils/json"

    (testpath/"example.jsonnet").write <<-EOS
      {
        person1: {
          name: "Alice",
          welcome: "Hello " + self.name + "!",
        },
        person2: self.person1 { name: "Bob" },
      }
    EOS

    expected_output = {
      "person1" => {
        "name" => "Alice",
        "welcome" => "Hello Alice!"
      },
      "person2" => {
        "name" => "Bob",
        "welcome" => "Hello Bob!"
      }
    }

    output = shell_output("#{bin}/jsonnet #{testpath}/example.jsonnet")
    assert_equal expected_output, Utils::JSON.load(output)
  end
end<commit_msg>jsonnet 0.8.8<commit_after>class Jsonnet < Formula
  desc "Domain specific configuration language for defining JSON data."
  homepage "https://google.github.io/jsonnet/doc/"
  url "https://github.com/google/jsonnet/archive/v0.8.8.tar.gz"
  sha256 "668f4ffe1796d22902a485e0c383c1e149dcf7b5364c1bd79e48d8a62b4943b9"

  bottle do
    cellar :any_skip_relocation
    sha256 "de8636d5e2c72b12302d0b580cc523dd69d42515df6b7e989d3f7d70bf12c626" => :el_capitan
    sha256 "a4f3f40594c54f87347348f1398610f1e7755f1328345572d259bd7d3a0564db" => :yosemite
    sha256 "d873d720f899167b86bb62aa7ef77c148e7daca45d16ecefc9b42e7a5b9185c4" => :mavericks
  end

  needs :cxx11

  depends_on :macos => :mavericks

  def install
    ENV.cxx11
    system "make"
    bin.install "jsonnet"
  end

  test do
    require "utils/json"

    (testpath/"example.jsonnet").write <<-EOS
      {
        person1: {
          name: "Alice",
          welcome: "Hello " + self.name + "!",
        },
        person2: self.person1 { name: "Bob" },
      }
    EOS

    expected_output = {
      "person1" => {
        "name" => "Alice",
        "welcome" => "Hello Alice!",
      },
      "person2" => {
        "name" => "Bob",
        "welcome" => "Hello Bob!",
      },
    }

    output = shell_output("#{bin}/jsonnet #{testpath}/example.jsonnet")
    assert_equal expected_output, Utils::JSON.load(output)
  end
end
{'fraction_non_alphanumeric': 0.12124502352515382, 'fraction_numerical': 0.13716974303293522, 'mean_word_length': 3.0057971014492755, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, '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': '3578482', 'n_tokens_mistral': 1293, 'n_tokens_neox': 1097, 'n_words': 166}