homebrew-core/Formula/jsonnet.rb
Hakan Baba 511d3a983f jsonnet 0.9.0
The release notes mention: Fix a segfault in the GC when using native
functions.

Some minor bug fixes.

Imported values are now cached after execution, resulting in a ~2x
performance improvement (measured on some real Jsonnet code).

Closes #6021.

Signed-off-by: Zhiming Wang <zmwangx@gmail.com>
2016-10-18 09:37:18 -04:00

52 lines
1.4 KiB
Ruby

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.9.0.tar.gz"
sha256 "8e1473cc5225b99d626cba44b85177e34bf458112df164d8a6ecc9475608795d"
bottle do
cellar :any_skip_relocation
sha256 "1ba55d4c886c8eddad8d497fb154fec5ad8e2cc3a297496fce2dbc673b4b207e" => :sierra
sha256 "514ae0343883f63d5f39ec27ceb38872a23de1c9d3ffc6ad23de9e0e07b74ed3" => :el_capitan
sha256 "e36044b2d7a55e276d28fdc061000d2ca2cd82dd5eccbee4c6a5198f2c0ae25e" => :yosemite
sha256 "e88d88f1c4b971dd91178e26158d792a1611623543a7297ccf458bdedcf4a5c8" => :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