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-18 22:34:49 +00:00
|
|
|
url "https://github.com/facebook/flow/archive/v0.20.1.tar.gz"
|
|
|
|
sha256 "0b2f7fc1eaa15c6ed8f39ddfd7f94e758e52b805c43efcf45d5acce6057eb705"
|
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-19 07:16:09 +00:00
|
|
|
sha256 "1fc3645f0463ca258c6ee32a39c65aaf1cabe9ebae9d0ddac454b6e70a440f92" => :el_capitan
|
|
|
|
sha256 "0bc223e406e920b7c8ae01df955dd19f2e0276c700ccef5869e314edccc8a99a" => :yosemite
|
|
|
|
sha256 "093e1283b36d0184f2f7c3b0e387a95ec3dffc40b1d38a12d5375112739d06d5" => :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
|