106 lines
4.6 KiB
Ruby
106 lines
4.6 KiB
Ruby
class Legit < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Command-line interface for Git, optimized for workflow simplicity"
|
|
homepage "https://www.git-legit.org/"
|
|
url "https://files.pythonhosted.org/packages/dc/bd/c24a5a5d285d2f92ac142cf5974ad5a7d52976c13b150713880e8b01c617/legit-1.0.0.tar.gz"
|
|
sha256 "53a67ad7a7caefab7a6c28a76d7967022e2aee956993b1b074cc4d8c78cc1500"
|
|
head "https://github.com/kennethreitz/legit.git", :branch => "develop"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "4315c020f3d8f45f1c9f73b12de153d5bd0ee795fde6e78e4518a48fc76aa11d" => :high_sierra
|
|
sha256 "68f7d736ef31e34d5ddeb1ab6dd7ddefe861780939b4182c07da417033b0aa00" => :sierra
|
|
sha256 "c22ae5da34a8c335f3405726fb36725e01de7aa54ed9c7759fbafa076d42c4e2" => :el_capitan
|
|
end
|
|
|
|
depends_on "python@2" if MacOS.version <= :snow_leopard
|
|
|
|
resource "appdirs" do
|
|
url "https://files.pythonhosted.org/packages/bd/66/0a7f48a0f3fb1d3a4072bceb5bbd78b1a6de4d801fb7135578e7c7b1f563/appdirs-1.4.0.tar.gz"
|
|
sha256 "8fc245efb4387a4e3e0ac8ebcc704582df7d72ff6a42a53f5600bbb18fdaadc5"
|
|
end
|
|
|
|
resource "args" do
|
|
url "https://files.pythonhosted.org/packages/e5/1c/b701b3f4bd8d3667df8342f311b3efaeab86078a840fb826bd204118cc6b/args-0.1.0.tar.gz"
|
|
sha256 "a785b8d837625e9b61c39108532d95b85274acd679693b71ebb5156848fcf814"
|
|
end
|
|
|
|
resource "click" do
|
|
url "https://files.pythonhosted.org/packages/95/d9/c3336b6b5711c3ab9d1d3a80f1a3e2afeb9d8c02a7166462f6cc96570897/click-6.7.tar.gz"
|
|
sha256 "f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b"
|
|
end
|
|
|
|
resource "clint" do
|
|
url "https://files.pythonhosted.org/packages/3d/b4/41ecb1516f1ba728f39ee7062b9dac1352d39823f513bb6f9e8aeb86e26d/clint-0.5.1.tar.gz"
|
|
sha256 "05224c32b1075563d0b16d0015faaf9da43aa214e4a2140e51f08789e7a4c5aa"
|
|
end
|
|
|
|
resource "colorama" do
|
|
url "https://files.pythonhosted.org/packages/e6/76/257b53926889e2835355d74fec73d82662100135293e17d382e2b74d1669/colorama-0.3.9.tar.gz"
|
|
sha256 "48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"
|
|
end
|
|
|
|
resource "crayons" do
|
|
url "https://files.pythonhosted.org/packages/14/fa/635fdd47686a0f29692d927333fcf39e0279fc39c81704866c97adc34053/crayons-0.1.2.tar.gz"
|
|
sha256 "5e17691605e564d63482067eb6327d01a584bbaf870beffd4456a3391bd8809d"
|
|
end
|
|
|
|
resource "gitdb2" do
|
|
url "https://files.pythonhosted.org/packages/5c/bb/ab74c6914e3b570ab2e960fda17a01aec93474426eecd3b34751ba1c3b38/gitdb2-2.0.0.tar.gz"
|
|
sha256 "b9f3209b401b8b4da5f94966c9c17650e66b7474ee5cd2dde5d983d1fba3ab66"
|
|
end
|
|
|
|
resource "GitPython" do
|
|
url "https://files.pythonhosted.org/packages/1c/08/a2b5ba4ad43c4c33066ced2c45958593ab2554bb0d09f7ecb9bf9092e5f6/GitPython-2.1.8.tar.gz"
|
|
sha256 "ad61bc25deadb535b047684d06f3654c001d9415e1971e51c9c20f5b510076e9"
|
|
end
|
|
|
|
resource "packaging" do
|
|
url "https://files.pythonhosted.org/packages/c6/70/bb32913de251017e266c5114d0a645f262fb10ebc9bf6de894966d124e35/packaging-16.8.tar.gz"
|
|
sha256 "5d50835fdf0a7edf0b55e311b7c887786504efea1177abd7e69329a8e5ea619e"
|
|
end
|
|
|
|
resource "pyparsing" do
|
|
url "https://files.pythonhosted.org/packages/38/bb/bf325351dd8ab6eb3c3b7c07c3978f38b2103e2ab48d59726916907cd6fb/pyparsing-2.1.10.tar.gz"
|
|
sha256 "811c3e7b0031021137fc83e051795025fcb98674d07eb8fe922ba4de53d39188"
|
|
end
|
|
|
|
resource "six" do
|
|
url "https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"
|
|
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
|
|
end
|
|
|
|
resource "smmap2" do
|
|
url "https://files.pythonhosted.org/packages/83/ce/e5b3aee7ca420b0ab24d4fcc2aa577f7aa6ea7e9306fafceabee3e8e4703/smmap2-2.0.1.tar.gz"
|
|
sha256 "5c9fd3ac4a30b85d041a8bd3779e16aa704a161991e74b9a46692bc368e68752"
|
|
end
|
|
|
|
def install
|
|
virtualenv_install_with_resources
|
|
bash_completion.install "extra/bash-completion/legit"
|
|
zsh_completion.install "extra/zsh-completion/_legit"
|
|
man1.install "extra/man/legit.1"
|
|
end
|
|
|
|
test do
|
|
(testpath/".gitconfig").write <<~EOS
|
|
[user]
|
|
name = Real Person
|
|
email = notacat@hotmail.cat
|
|
EOS
|
|
system "git", "init"
|
|
(testpath/"foo").write("woof")
|
|
system "git", "add", "foo"
|
|
system "git", "commit", "-m", "init"
|
|
system "git", "remote", "add", "origin", "https://github.com/git/git.git"
|
|
system "git", "branch", "test"
|
|
inreplace "foo", "woof", "meow"
|
|
assert_match "test", shell_output("#{bin}/legit branches")
|
|
output = shell_output("#{bin}/legit switch test")
|
|
assert_equal "Switched to branch 'test'", output.strip.lines.last
|
|
assert_equal "woof", (testpath/"foo").read
|
|
system "git", "stash", "pop"
|
|
assert_equal "meow", (testpath/"foo").read
|
|
end
|
|
end
|