2017-02-01 08:08:43 +00:00
|
|
|
require "language/node"
|
|
|
|
|
|
|
|
class Babel < Formula
|
|
|
|
desc "Compiler for writing next generation JavaScript"
|
|
|
|
homepage "https://babeljs.io/"
|
2017-02-14 09:01:35 +00:00
|
|
|
url "https://registry.npmjs.org/babel-cli/-/babel-cli-6.23.0.tgz"
|
|
|
|
sha256 "76cccec388472ff02274e27f9fa9657f5a88af5f2da02c9eebb6d92351d06c34"
|
2017-02-01 08:08:43 +00:00
|
|
|
|
2017-02-01 08:39:49 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2017-02-14 09:05:22 +00:00
|
|
|
sha256 "c7e63adb35ef55305e100deeba0a70531840ecec7fd36621b87c972e8569769d" => :sierra
|
|
|
|
sha256 "f40c7bde8a92aa6c4379e4fc2fb57ae18ba938d32e6946f7df31e89be9551f82" => :el_capitan
|
|
|
|
sha256 "fa8e7ac3d0ad66013745fe499bec73982c3cd4a18a24fdca707ecc42d4a5d821" => :yosemite
|
2017-02-01 08:39:49 +00:00
|
|
|
end
|
|
|
|
|
2017-02-01 08:08:43 +00:00
|
|
|
depends_on "node"
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
|
|
|
|
bin.install_symlink Dir["#{libexec}/bin/*"]
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"script.js").write <<-EOS.undent
|
|
|
|
[1,2,3].map(n => n + 1);
|
|
|
|
EOS
|
|
|
|
|
|
|
|
system bin/"babel", "script.js", "--out-file", "script-compiled.js"
|
|
|
|
assert File.exist?("script-compiled.js"), "script-compiled.js was not generated"
|
|
|
|
end
|
|
|
|
end
|