class Thefuck < Formula include Language::Python::Virtualenv desc "Programatically correct mistyped console commands" homepage "https://github.com/nvbn/thefuck" url "https://files.pythonhosted.org/packages/19/b0/5a563805cd59ad99b46a82fad0008ff6d9b55b61db88d8839b448c45b63c/thefuck-3.29.tar.gz" sha256 "7b907b6ef6863cc0d3e9bb3e573054547a60f89572250b767ccadb317d3c8297" head "https://github.com/nvbn/thefuck.git" bottle do cellar :any_skip_relocation sha256 "a9e1c5b8a788445cbddb0c75e76b15855e2f7d38ff97730213a58266b7c67848" => :catalina sha256 "e0d8a79a9c0c301c9d5316983ee95aaeb582ae354a6dcd1bec3ae3a16e2920bf" => :mojave sha256 "5eec27cd3a36614f7042b2936f943fa1a173c00f90a46b37e199ef3f359b38ab" => :high_sierra sha256 "dbac00409d1662ad5c566f0936c296fba3dc42ce59cfa49b3bd5eb6fb9972cf5" => :sierra end depends_on "python" resource "colorama" do url "https://files.pythonhosted.org/packages/76/53/e785891dce0e2f2b9f4b4ff5bc6062a53332ed28833c7afede841f46a5db/colorama-0.4.1.tar.gz" sha256 "05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d" end resource "decorator" do url "https://files.pythonhosted.org/packages/ba/19/1119fe7b1e49b9c8a9f154c930060f37074ea2e8f9f6558efc2eeaa417a2/decorator-4.4.0.tar.gz" sha256 "86156361c50488b84a3f148056ea716ca587df2f0de1d34750d35c21312725de" end resource "psutil" do url "https://files.pythonhosted.org/packages/c6/c1/beed5e4eaa1345901b595048fab1c85aee647ea0fc02d9e8bf9aceb81078/psutil-5.6.2.tar.gz" sha256 "828e1c3ca6756c54ac00f1427fdac8b12e21b8a068c3bb9b631a1734cada25ed" end resource "pyte" do url "https://files.pythonhosted.org/packages/66/37/6fed89b484c8012a0343117f085c92df8447a18af4966d25599861cd5aa0/pyte-0.8.0.tar.gz" sha256 "7e71d03e972d6f262cbe8704ff70039855f05ee6f7ad9d7129df9c977b5a88c5" end resource "six" do url "https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz" sha256 "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" end resource "wcwidth" do url "https://files.pythonhosted.org/packages/55/11/e4a2bb08bb450fdbd42cc709dd40de4ed2c472cf0ccb9e64af22279c5495/wcwidth-0.1.7.tar.gz" sha256 "3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e" end def install virtualenv_install_with_resources end def caveats; <<~EOS Add the following to your .bash_profile, .bashrc or .zshrc: eval $(thefuck --alias) For other shells, check https://github.com/nvbn/thefuck/wiki/Shell-aliases EOS end test do ENV["THEFUCK_REQUIRE_CONFIRMATION"] = "false" ENV["LC_ALL"] = "en_US.UTF-8" output = shell_output("#{bin}/thefuck --version 2>&1") assert_match "The Fuck #{version} using Python", output output = shell_output("#{bin}/thefuck --alias") assert_match "TF_ALIAS=fuck", output output = shell_output("#{bin}/thefuck git branchh") assert_equal "git branch", output.chomp output = shell_output("#{bin}/thefuck echho ok") assert_equal "echo ok", output.chomp output = shell_output("#{bin}/fuck") assert_match "Seems like fuck alias isn't configured!", output end end