class Yarn < Formula desc "JavaScript package manager" homepage "https://yarnpkg.com/" url "https://yarnpkg.com/downloads/0.27.5/yarn-v0.27.5.tar.gz" sha256 "f0f3510246ee74eb660ea06930dcded7b684eac2593aa979a7add84b72517968" revision 1 devel do url "https://yarnpkg.com/downloads/0.28.4/yarn-v0.28.4.tar.gz" sha256 "057ef781107bb5d3e7a2a655d75054fbeb265a249a905375bc25bec10d42b31f" end bottle :unneeded depends_on "node" => :recommended def install libexec.install Dir["*"] (bin/"yarn").write_env_script "#{libexec}/bin/yarn.js", :PREFIX => HOMEBREW_PREFIX (bin/"yarnpkg").write_env_script "#{libexec}/bin/yarn.js", :PREFIX => HOMEBREW_PREFIX inreplace "#{libexec}/package.json", '"installationMethod": "tar"', '"installationMethod": "homebrew"' end test do (testpath/"package.json").write('{"name": "test"}') system bin/"yarn", "add", "jquery" end end