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-09-10 17:39:04 +00:00
|
|
|
url "https://github.com/facebook/flow/archive/v0.15.0.tar.gz"
|
|
|
|
sha256 "4040b3dba2771904f5ce2e4f6fbe2052d452d0aca717bb571de92f4e9e91004c"
|
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
|
|
|
|
cellar :any
|
2015-09-05 03:12:59 +00:00
|
|
|
revision 1
|
|
|
|
sha256 "4a98a4f86ee69e8e20533d55bad144f0350fee215f69208107256079f6e33bc6" => :yosemite
|
|
|
|
sha256 "f15b160c6c831e63e67b40e02b84c917df59bc255e958ec107e001b0301bcd00" => :mavericks
|
|
|
|
sha256 "e2ebbc4a28a9c460194b738b7fe5a1933674ae21ba520ddaf0485c3f520532e3" => :mountain_lion
|
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-08-31 20:41:17 +00:00
|
|
|
system "#{bin}/flow init #{testpath}"
|
|
|
|
(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/
|
|
|
|
assert_match expected, shell_output("#{bin}/flow check #{testpath}", 2)
|
2014-11-18 18:57:59 +00:00
|
|
|
end
|
|
|
|
end
|