homebrew-core/Formula/wtfutil.rb
2019-08-02 04:30:30 +08:00

76 lines
2.1 KiB
Ruby

class Wtfutil < Formula
desc "The personal information dashboard for your terminal"
homepage "https://wtfutil.com"
url "https://github.com/wtfutil/wtf.git",
:tag => "v0.19.1",
:revision => "45da40e4c9ffe35a3c0501f580edc8a5182c9546"
bottle do
cellar :any_skip_relocation
sha256 "b2861f35be5715ead8879fdcd075f8ddbf109485026b6cf6f820061daa926bc7" => :mojave
sha256 "5df2d7ebd53d0770dc24c90fb800987863688a26426e1290a33a365d75427896" => :high_sierra
sha256 "ac3b99c16c2034ece2e68445b4f7be8426cc162578dad7f2a9042aea9366001a" => :sierra
end
depends_on "go" => :build
def install
ENV["GO111MODULE"] = "on"
ENV["GOPATH"] = buildpath
ENV["GOPROXY"] = "https://gocenter.io"
dir = buildpath/"src/github.com/wtfutil/wtf"
dir.install buildpath.children
cd dir do
system "go", "build", "-o", bin/"wtfutil"
prefix.install_metafiles
end
end
test do
testconfig = testpath/"config.yml"
testconfig.write <<~EOS
wtf:
colors:
background: "red"
border:
focusable: "darkslateblue"
focused: "orange"
normal: "gray"
checked: "gray"
highlight:
fore: "black"
back: "green"
text: "white"
title: "white"
grid:
# How _wide_ the columns are, in terminal characters. In this case we have
# six columns, each of which are 35 characters wide
columns: [35, 35, 35, 35, 35, 35]
# How _high_ the rows are, in terminal lines. In this case we have five rows
# that support ten line of text, one of three lines, and one of four
rows: [10, 10, 10, 10, 10, 3, 4]
navigation:
shortcuts: true
openFileUtil: "open"
sigils:
checkbox:
checked: "x"
unchecked: " "
paging:
normal: "*"
selected: "_"
term: "xterm-256color"
EOS
begin
pid = fork do
exec "#{bin}/wtfutil", "--config=#{testconfig}"
end
ensure
Process.kill("HUP", pid)
end
end
end