class Legit < Formula include Language::Python::Virtualenv desc "Command-line interface for Git, optimized for workflow simplicity" homepage "https://frostming.github.io/legit/" url "https://files.pythonhosted.org/packages/cb/e4/8cc5904c486241bf2edc4dd84f357fa96686dc85f48eedb835af65f821bf/legit-1.2.0.post0.tar.gz" version "1.2.0.post0" sha256 "949396b68029a8af405ab20c901902341ef6bd55c7fec6dab71141d63d406b11" license "BSD-3-Clause" head "https://github.com/frostming/legit.git", branch: "master" bottle do cellar :any_skip_relocation sha256 "f8e751f24ec29945d19282e2ba4ebbde289f29365c62e2083792bae79b1be7b9" => :catalina sha256 "3cf90c6383f7a7f0be82aeef8605775de297b3911484d2472970562031d2d008" => :mojave sha256 "cec24c2e497d9b8c162a06fb867778da3ecb08fe8ff7299a386c8abf1a03f895" => :high_sierra end depends_on "python@3.8" 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/76/53/e785891dce0e2f2b9f4b4ff5bc6062a53332ed28833c7afede841f46a5db/colorama-0.4.1.tar.gz" sha256 "05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d" 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/c5/62/ed7205331e8d7cc377e2512cb32f8f8f075c0defce767551d0a76e102ce2/gitdb2-2.0.6.tar.gz" sha256 "1b6df1433567a51a4a9c1a5a0de977aa351a405cc56d7d35f3388bad1f630350" end resource "GitPython" do url "https://files.pythonhosted.org/packages/1c/08/a2b5ba4ad43c4c33066ced2c45958593ab2554bb0d09f7ecb9bf9092e5f6/GitPython-2.1.8.tar.gz" sha256 "ad61bc25deadb535b047684d06f3654c001d9415e1971e51c9c20f5b510076e9" end resource "six" do url "https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz" sha256 "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" end resource "smmap2" do url "https://files.pythonhosted.org/packages/3b/ba/e49102b3e8ffff644edded25394b2d22ebe3e645f3f6a8139129c4842ffe/smmap2-2.0.5.tar.gz" sha256 "29a9ffa0497e7f2be94ca0ed1ca1aa3cd4cf25a1f6b4f5f87f74b46ed91d609a" 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