2014-11-18 18:57:59 +00:00
|
|
|
class Flow < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Static type checker for JavaScript"
|
2014-11-18 18:57:59 +00:00
|
|
|
homepage "http://flowtype.org/"
|
2015-12-03 23:04:49 +00:00
|
|
|
url "https://github.com/facebook/flow/archive/v0.19.1.tar.gz"
|
|
|
|
sha256 "172513a5f8fb785b05c408cdfef4a7b4ca31fdfa8e77e88c506ce5a9849a0f3f"
|
2014-11-18 18:57:59 +00:00
|
|
|
head "https://github.com/facebook/flow.git"
|
|
|
|
|
2014-11-19 10:16:30 +00:00
|
|
|
bottle do
|
2015-09-13 19:35:34 +00:00
|
|
|
cellar :any_skip_relocation
|
2015-12-03 23:30:28 +00:00
|
|
|
sha256 "443b433019fbd5b0cad6fa1288328ad3bb03ef68d7850ba11a909cf7213f9eab" => :el_capitan
|
|
|
|
sha256 "6b5b3548ce35acfad6690f2aeaf74b0c1886e0d3c67cef713fd34dc69db66fb7" => :yosemite
|
|
|
|
sha256 "5d349b616fea1a70724a6cf176b5e39265b7f6aa0a07aeb499eadce02618e8a5" => :mavericks
|
2014-11-19 10:16:30 +00:00
|
|
|
end
|
|
|
|
|
2015-09-02 23:43:23 +00:00
|
|
|
depends_on "ocaml" => :build
|
2014-11-18 18:57:59 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
system "make"
|
|
|
|
bin.install "bin/flow"
|
2015-06-02 21:22:02 +00:00
|
|
|
|
|
|
|
bash_completion.install "resources/shell/bash-completion" => "flow-completion.bash"
|
|
|
|
zsh_completion.install_symlink bash_completion/"flow-completion.bash" => "_flow"
|
2014-11-18 18:57:59 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-10-05 13:50:21 +00:00
|
|
|
system "#{bin}/flow", "init", testpath
|
2015-08-31 20:41:17 +00:00
|
|
|
(testpath/"test.js").write <<-EOS.undent
|
|
|
|
/* @flow */
|
|
|
|
var x: string = 123;
|
|
|
|
EOS
|
|
|
|
expected = /number\nThis type is incompatible with\n.*string\n\nFound 1 error/
|
2015-10-07 18:19:38 +00:00
|
|
|
assert_match expected, shell_output("#{bin}/flow check --old-output-format #{testpath}", 2)
|
2014-11-18 18:57:59 +00:00
|
|
|
end
|
|
|
|
end
|