forked from moul/homebrew-moul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sapin.rb
42 lines (34 loc) · 1.05 KB
/
sapin.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require "language/go"
class Sapin < Formula
desc "Draw a beautiful christmas tree in ascii"
homepage "https://github.com/moul/sapin"
url "https://github.com/moul/sapin/archive/v1.1.0.tar.gz"
sha256 "b46f4eea39b383825d2646bdbb63f1e98775027de83625f1e9362eefbf112161"
head "https://github.com/moul/sapin.git"
depends_on "go" => :build
depends_on "godep" => :build
depends_on "jq" => :build
def install
ENV["GOPATH"] = buildpath
ENV["CGO_ENABLED"] = "0"
ENV["GO15VENDOREXPERIMENT"] = "1"
ENV.prepend_create_path "PATH", buildpath/"bin"
mkdir_p buildpath/"src/github.com/moul"
ln_s buildpath, buildpath/"src/github.com/moul/sapin"
Language::Go.stage_deps resources, buildpath/"src"
system "godep", "restore"
system "make", "build"
bin.install "sapin"
# bash_completion.install "contrib/completion/bash/sapin"
# zsh_completion.install "contrib/completion/zsh/_sapin"
end
test do
output = shell_output(bin/"sapin --size=1")
assert output.include? "
*
***
*****
*******
|"[1..-1]
end
end