2016-04-12 13:58:53 +00:00
|
|
|
require "language/node"
|
|
|
|
|
2016-03-13 13:05:06 +00:00
|
|
|
class Elixirscript < Formula
|
|
|
|
desc "Elixir to JavaScript compiler"
|
|
|
|
homepage "https://github.com/bryanjos/elixirscript"
|
2016-10-17 04:57:21 +00:00
|
|
|
url "https://github.com/bryanjos/elixirscript/archive/v0.22.0.tar.gz"
|
|
|
|
sha256 "371d114e9e6be7a7d944d4e4d191b379327e1a57c888a80d00f3d9374cef57b0"
|
2016-03-13 13:05:06 +00:00
|
|
|
|
2016-03-14 14:49:20 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-10-17 05:15:50 +00:00
|
|
|
sha256 "79d5db73b7a3f75e4948ce2312fc7dd9e405e6e16b9a131e97510b4d1e82878c" => :sierra
|
|
|
|
sha256 "643108b4b01f6ccff7eb169c44384fe703c8172c5ac1ac4080347bc9526a3480" => :el_capitan
|
|
|
|
sha256 "73e196bbaeb7c8c40c1623029743809424fa0e4af60265acb6326c8c0f952f39" => :yosemite
|
2016-03-14 14:49:20 +00:00
|
|
|
end
|
|
|
|
|
2016-03-13 13:05:06 +00:00
|
|
|
depends_on "elixir" => :build
|
2016-03-31 21:12:19 +00:00
|
|
|
depends_on "node" => :build
|
2016-03-13 13:05:06 +00:00
|
|
|
|
|
|
|
def install
|
2016-07-20 11:30:00 +00:00
|
|
|
ENV["MIX_ENV"] = "prod"
|
|
|
|
|
2016-03-13 13:05:06 +00:00
|
|
|
system "mix", "local.hex", "--force"
|
2016-07-20 11:30:00 +00:00
|
|
|
system "mix", "local.rebar", "--force"
|
2016-03-13 13:05:06 +00:00
|
|
|
system "mix", "deps.get"
|
2016-04-12 13:58:53 +00:00
|
|
|
system "npm", "install", *Language::Node.local_npm_install_args
|
2016-03-31 21:12:19 +00:00
|
|
|
system "mix", "std_lib"
|
|
|
|
system "mix", "clean"
|
|
|
|
system "mix", "compile"
|
|
|
|
system "mix", "dist"
|
2016-07-20 11:30:00 +00:00
|
|
|
system "mix", "test"
|
|
|
|
system "npm", "test"
|
|
|
|
|
|
|
|
ENV.delete("MIX_ENV")
|
|
|
|
system "mix", "docs"
|
|
|
|
|
2016-03-13 13:05:06 +00:00
|
|
|
bin.install "elixirscript"
|
2016-07-20 11:30:00 +00:00
|
|
|
prefix.install Dir["priv/*"]
|
|
|
|
doc.install Dir["doc/*"]
|
2016-03-13 13:05:06 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2016-07-20 11:30:00 +00:00
|
|
|
output = shell_output("#{bin}/elixirscript -ex :keith")
|
|
|
|
assert_equal "Symbol.for('keith')", output.strip
|
2016-03-13 13:05:06 +00:00
|
|
|
end
|
|
|
|
end
|