60 lines
1.7 KiB
Ruby
60 lines
1.7 KiB
Ruby
require "language/go"
|
|
|
|
class Exercism < Formula
|
|
desc "command-line tool to interact with exercism.io"
|
|
homepage "http://cli.exercism.io"
|
|
url "https://github.com/exercism/cli/archive/v2.2.3.tar.gz"
|
|
sha256 "ec04288438d8c7db89c430a2e7ca81c95a22a9826d024f25b31e09181db9c84d"
|
|
head "https://github.com/exercism.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "c0d211756fb72eecb17a91f9933a87bd6f1792483ce7e4d094146e101730d7de" => :el_capitan
|
|
sha256 "a36773c644c7965855ba9725634aceb59828e199ac29cbecd24af79ca35f17a1" => :yosemite
|
|
sha256 "d2ee8aa4d28a0192c163ccc0b07282b90a331d450d31b562a8331bb584cde2f2" => :mavericks
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
go_resource "github.com/codegangsta/cli" do
|
|
url "https://github.com/codegangsta/cli.git",
|
|
:revision => "bca61c476e3c752594983e4c9bcd5f62fb09f157"
|
|
end
|
|
|
|
go_resource "github.com/kardianos/osext" do
|
|
url "https://github.com/kardianos/osext.git",
|
|
:revision => "6e7f843663477789fac7c02def0d0909e969b4e5"
|
|
end
|
|
|
|
go_resource "golang.org/x/net" do
|
|
url "https://github.com/golang/net.git",
|
|
:revision => "d9558e5c97f85372afee28cf2b6059d7d3818919"
|
|
end
|
|
|
|
go_resource "golang.org/x/text" do
|
|
url "https://github.com/golang/text.git",
|
|
:revision => "3eb7007b740b66a77f3c85f2660a0240b284115a"
|
|
end
|
|
|
|
def install
|
|
ENV["GOBIN"] = bin
|
|
ENV["GOPATH"] = buildpath
|
|
ENV["GOHOME"] = buildpath
|
|
|
|
path = buildpath/"src/github.com/exercism/cli"
|
|
path.install Dir["*"]
|
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
cd path do
|
|
system "go", "build", "./exercism/main.go"
|
|
end
|
|
|
|
bin.install path/"main" => "exercism"
|
|
end
|
|
|
|
test do
|
|
assert_equal "exercism version #{version}",
|
|
shell_output("#{bin}/exercism --version").strip
|
|
end
|
|
end
|