2014-11-18 18:57:59 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
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-06-11 21:40:14 +00:00
|
|
|
url "https://github.com/facebook/flow/archive/v0.12.0.tar.gz"
|
|
|
|
sha1 "fd8edf6cf291d66bc20053dd02eb66507f36023a"
|
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-06-12 00:46:47 +00:00
|
|
|
sha256 "fd20aff1d786aadebfd990ed571b0cca8d93083a8bda89245a89f5ac9dd70a55" => :yosemite
|
|
|
|
sha256 "16516306bae3cb264733f706fbb6ea5ede2b25d7aedc32a21663964741e62417" => :mavericks
|
|
|
|
sha256 "2a6fc52ef06dbce0bb65f3ffb4022681e3ccfca67526f86cc5e36e87ce2d4de5" => :mountain_lion
|
2014-11-19 10:16:30 +00:00
|
|
|
end
|
|
|
|
|
2014-11-18 18:57:59 +00:00
|
|
|
depends_on "objective-caml" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "make"
|
|
|
|
bin.install "bin/flow"
|
|
|
|
(share/"flow").install "bin/examples"
|
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
|
|
|
|
output = `#{bin}/flow single #{share}/flow/examples/01_HelloWorld`
|
|
|
|
assert_match(/This type is incompatible with/, output)
|
|
|
|
assert_match(/Found 1 error/, output)
|
|
|
|
end
|
|
|
|
end
|