babel 6.22.2 (new formula)

Closes #9517.

Signed-off-by: William Woodruff <william@tuffbizz.com>
master
Chris Long 2017-02-01 00:08:43 -08:00 committed by William Woodruff
parent 77ae34ecbe
commit 4d6b7871fb
No known key found for this signature in database
GPG Key ID: 85AE00C504833B3C
1 changed files with 24 additions and 0 deletions

24
Formula/babel.rb Normal file
View File

@ -0,0 +1,24 @@
require "language/node"
class Babel < Formula
desc "Compiler for writing next generation JavaScript"
homepage "https://babeljs.io/"
url "https://registry.npmjs.org/babel-cli/-/babel-cli-6.22.2.tgz"
sha256 "209ea6087373d542b8bfb43f5d9188a07ca8864de370fba61ecd03f14cb4eb9a"
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