homebrew-core/Formula/flow.rb
2016-09-02 19:45:04 -07:00

35 lines
1.2 KiB
Ruby

class Flow < Formula
desc "Static type checker for JavaScript"
homepage "https://flowtype.org/"
url "https://github.com/facebook/flow/archive/v0.32.0.tar.gz"
sha256 "0dc6316e265b20c1b9fb8ae2b45ee5c7ae0315f2724c3c8f8a5de7782efe3467"
head "https://github.com/facebook/flow.git"
bottle do
cellar :any_skip_relocation
sha256 "1b84691a232c771cdde97fbdb2cdf7b2fce3aa4d9e341b1f7169d0424614b6ba" => :el_capitan
sha256 "b7210405ec81f9a68a0eba2b1333161f03be930125464a832becab1185afb7f5" => :yosemite
sha256 "64e79ab56f20438efc7a9c21c2555cb7abb3086ef74fb5f6f8b075921447847b" => :mavericks
end
depends_on "ocaml" => :build
depends_on "ocamlbuild" => :build
def install
system "make"
bin.install "bin/flow"
bash_completion.install "resources/shell/bash-completion" => "flow-completion.bash"
zsh_completion.install_symlink bash_completion/"flow-completion.bash" => "_flow"
end
test do
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 --old-output-format #{testpath}", 2)
end
end