From ca90d6cbb8fd360e7a5062405ba5b0b6622f7cce Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Wed, 31 Jan 2018 22:18:19 +0100 Subject: [PATCH] unravel 0.2.2 (new formula) Closes #23530. Signed-off-by: ilovezfs --- Formula/unravel.rb | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Formula/unravel.rb diff --git a/Formula/unravel.rb b/Formula/unravel.rb new file mode 100644 index 0000000000..a4103b766e --- /dev/null +++ b/Formula/unravel.rb @@ -0,0 +1,33 @@ +require "language/node" + +class Unravel < Formula + desc "Command-line client for Clojure REPLs" + homepage "https://github.com/pesterhazy/unravel" + url "https://github.com/pesterhazy/unravel/archive/0.2.2.tar.gz" + sha256 "144b2a96dc5900dada9e668f765ac63d55b97770525f1c994b8b41084048a9cc" + + devel do + url "https://github.com/Unrepl/unravel/archive/v0.3.0-beta.2.tar.gz" + sha256 "786acffe0a2b0dc7fb2675215764739fee39a5da1b9ac72d7c8c49afab785408" + end + + depends_on "lumo" + depends_on "node" + + def install + # This is installed by Homebrew + inreplace "package.json", /"lumo-cljs": ".+?",/, "" + inreplace "bin/unravel", + '"${UNRAVEL_HOME}/node_modules/lumo-cljs/bin/lumo"', "lumo" + + system "npm", "install", *Language::Node.std_npm_install_args(libexec) + + (bin/"unravel").write_env_script libexec/"bin/unravel", + :UNRAVEL_HOME => libexec/"lib/node_modules/unravel-repl" + end + + test do + # We'd need a REPL to connect to in order to have a proper test + assert_match "Socket error", shell_output("#{bin}/unravel localhost 1", 1) + end +end