2012-05-26 19:09:34 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class ErlangInstalled < Requirement
|
|
|
|
def message; <<-EOS.undent
|
|
|
|
Erlang 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
|
|
|
|
|
|
|
|
def satisfied?
|
|
|
|
which 'erl'
|
|
|
|
end
|
|
|
|
|
|
|
|
def fatal?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Elixir < Formula
|
|
|
|
homepage 'http://elixir-lang.org/'
|
2012-08-01 06:58:27 +00:00
|
|
|
url 'https://github.com/elixir-lang/elixir/tarball/v0.6.0'
|
|
|
|
sha1 '618e66e037c2d930428ca75a11b4e9648caffb9a'
|
2012-05-26 19:09:34 +00:00
|
|
|
|
2012-08-01 06:58:27 +00:00
|
|
|
head 'https://github.com/elixir-lang/elixir.git', :branch => "stable"
|
2012-05-26 19:09:34 +00:00
|
|
|
|
|
|
|
depends_on ErlangInstalled.new
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "make"
|
|
|
|
bin.install Dir['bin/*'] - Dir['bin/*.bat']
|
2012-08-01 06:58:27 +00:00
|
|
|
|
|
|
|
Dir['lib/*/ebin'].each do |path|
|
|
|
|
app = File.basename(File.dirname(path))
|
|
|
|
(lib/"#{app}/ebin").install path
|
|
|
|
end
|
2012-05-26 19:09:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test
|
|
|
|
system "#{bin}/elixir -v"
|
|
|
|
end
|
|
|
|
end
|