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/"
|
2016-02-22 03:07:01 +00:00
|
|
|
url "https://github.com/facebook/flow/archive/v0.22.0.tar.gz"
|
|
|
|
sha256 "12c0ae94fbf95913f3ce522d07531a1f8b15678cdbfe14300d78d7d0ff997bef"
|
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
|
2016-02-22 03:23:10 +00:00
|
|
|
sha256 "99d667a30b2c44f943e2fef2a7407be4d2066984d275998195ce95768469168d" => :el_capitan
|
|
|
|
sha256 "1cc3b42f3938d7dcf3f04c989904b1ab400a5d8e61eceaece5ad6e4fe1d6edac" => :yosemite
|
|
|
|
sha256 "fca142de488ad45a8672cd0559d317ee55680bd00d8041e0bbd8e0935b32ee2a" => :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
|