homebrew-core/Formula/git-secret.rb

35 lines
1.2 KiB
Ruby

class GitSecret < Formula
desc "Bash-tool to store the private data inside a git repo."
homepage "https://sobolevn.github.io/git-secret/"
url "https://github.com/sobolevn/git-secret/archive/v0.2.2.tar.gz"
sha256 "a4672c2d5eca7b5c3b27388060609307b851edc7f7b653e1d21e3e0b328f43f4"
head "https://github.com/sobolevn/git-secret.git"
bottle do
cellar :any_skip_relocation
sha256 "560e8aaaa04b0bfa45596ddbbd6adacf0ce709481643b407eaeed9971edb30a0" => :sierra
sha256 "560e8aaaa04b0bfa45596ddbbd6adacf0ce709481643b407eaeed9971edb30a0" => :el_capitan
sha256 "560e8aaaa04b0bfa45596ddbbd6adacf0ce709481643b407eaeed9971edb30a0" => :yosemite
end
depends_on :gpg => :recommended
def install
system "make", "build"
system "bash", "utils/install.sh", prefix
end
test do
Gpg.create_test_key(testpath)
system "git", "init"
system "git", "config", "user.email", "testing@foo.bar"
system "git", "secret", "init"
assert_match "testing@foo.bar added", shell_output("git secret tell -m")
(testpath/"shh.txt").write "Top Secret"
(testpath/".gitignore").write "shh.txt"
system "git", "secret", "add", "shh.txt"
system "git", "secret", "hide"
assert File.exist?("shh.txt.secret")
end
end