Skip to content

Instantly share code, notes, and snippets.

@edgurgel
Created March 28, 2014 02:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edgurgel/9823561 to your computer and use it in GitHub Desktop.
Save edgurgel/9823561 to your computer and use it in GitHub Desktop.
WTH 0.0.3 formula
require "formula"
# https://github.com/Homebrew/homebrew/blob/master/Library/Formula/elixir.rb
class ErlangInstalled < Requirement
fatal true
default_formula 'erlang'
env :userpaths
satisfy {
erl = which('erl') and begin
`#{erl} -noshell -eval 'io:fwrite("~s~n", [erlang:system_info(otp_release)]).' -s erlang halt | grep -q '^R1[6789]'`
$?.exitstatus == 0
end
}
def message; <<-EOS.undent
Erlang R16 is required to install.
You can install this with:
brew install erlang
Or you can use an official installer from:
http://www.erlang.org/
EOS
end
end
class Wth < Formula
homepage "https//github.com/edgurgel/wth"
url "https://github.com/edgurgel/wth/releases/download/0.0.3/wth.tar.gz"
sha1 "64e837073b22258f0e7eb9dea994b483619d1dc1"
depends_on ErlangInstalled
def install
bin.install "wth"
end
test do
system "#{bin}/wth", "--help"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment