2018-01-17 18:14:20 +00:00
|
|
|
class Plank < Formula
|
|
|
|
desc "Framework for generating immutable model objects"
|
|
|
|
homepage "https://pinterest.github.io/plank/"
|
2018-03-09 06:30:35 +00:00
|
|
|
url "https://github.com/pinterest/plank/archive/v1.4.1.tar.gz"
|
|
|
|
sha256 "021889470c1568364fb12e3c704ab98e74c5992749a244a1ef785dd870cad57b"
|
2018-01-17 18:14:20 +00:00
|
|
|
|
2018-01-19 20:19:03 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2018-03-05 22:39:32 +00:00
|
|
|
sha256 "29a4c506b5ac1c50a4f98a06b7744f3357f62746a81ca962c017efda64d11c97" => :high_sierra
|
|
|
|
sha256 "eb7fa60cd4a4ba5c93c7f58a7df2843895d97d3dd9797148a7a29bc6d69140fe" => :sierra
|
2018-01-19 20:19:03 +00:00
|
|
|
end
|
|
|
|
|
2018-01-17 18:14:20 +00:00
|
|
|
depends_on :xcode => ["9.0", :build]
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "make", "install", "PREFIX=#{prefix}"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"pin.json").write <<~EOS
|
|
|
|
{
|
|
|
|
"id": "pin.json",
|
|
|
|
"title": "pin",
|
|
|
|
"description" : "Schema definition of a Pin",
|
|
|
|
"$schema": "http://json-schema.org/schema#",
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"id": { "type": "string" },
|
|
|
|
"link": { "type": "string", "format": "uri"}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system "#{bin}/plank", "--lang", "objc,flow", "--output_dir", testpath, "pin.json"
|
|
|
|
assert_predicate testpath/"Pin.h", :exist?, "[ObjC] Generated file does not exist"
|
|
|
|
assert_predicate testpath/"PinType.js", :exist?, "[Flow] Generated file does not exist"
|
|
|
|
end
|
|
|
|
end
|