diff --git a/Formula/chakra.rb b/Formula/chakra.rb new file mode 100644 index 0000000..e037640 --- /dev/null +++ b/Formula/chakra.rb @@ -0,0 +1,16 @@ +class Chakra < Formula + desc "The core part of the Chakra JavaScript engine that powers Microsoft Edge" + homepage "https://github.com/Microsoft/ChakraCore" + url "https://aka.ms/chakracore/cc_osx_x64_2_0_0.tar.gz" + sha256 "a546eb1735b2fb0054f2aca592596ede09f3d613b81ce10bc6d216e0dd19c2e6" + + def install + lib.install "ChakraCoreFiles/lib/libChakraCore.dylib" + bin.install "ChakraCoreFiles/bin/ch" => "chakra" + end + + test do + (testpath/"test.js").write("print('Hello!');\n") + assert_equal "Hello!", shell_output("#{bin}/chakra test.js").chomp + end +end