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/b8/87/0dac1eb9797cbfade40b2565e3b3bae727c0793887595277cb49c8d6fd45/thefuck-3.18.tar.gz" sha256 "e7a5f728b5ab2e2654e1256341f2df7545a872494aeb574d72214610bca0fe7b" head "https://github.com/nvbn/thefuck.git" bottle do cellar :any_skip_relocation sha256 "287b1a0c768cef5027dce94249249720f337e7cb5233d221979d8b700ee3af1d" => :sierra sha256 "9c706102129a24713e417de97999f3623b3df05e366c83ad8c063f2dc79c9751" => :el_capitan sha256 "7ecc647f71c80eb862098ebc6cd1e16b224d7de962df266111e0d58cb41ab88a" => :yosemite end depends_on :python if MacOS.version <= :snow_leopard resource "colorama" do url "https://files.pythonhosted.org/packages/e6/76/257b53926889e2835355d74fec73d82662100135293e17d382e2b74d1669/colorama-0.3.9.tar.gz" sha256 "48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1" end resource "decorator" do url "https://files.pythonhosted.org/packages/cc/ac/5a16f1fc0506ff72fcc8fd4e858e3a1c231f224ab79bb7c4c9b2094cc570/decorator-4.0.11.tar.gz" sha256 "953d6bf082b100f43229cf547f4f97f97e970f5ad645ee7601d55ff87afdfe76" end resource "pathlib2" do url "https://files.pythonhosted.org/packages/ab/d8/ac7489d50146f29d0a14f65545698f4545d8a6b739b24b05859942048b56/pathlib2-2.2.1.tar.gz" sha256 "ce9007df617ef6b7bd8a31cd2089ed0c1fed1f7c23cf2bf1ba140b3dd563175d" end resource "psutil" do url "https://files.pythonhosted.org/packages/57/93/47a2e3befaf194ccc3d05ffbcba2cdcdd22a231100ef7e4cf63f085c900b/psutil-5.2.2.tar.gz" sha256 "44746540c0fab5b95401520d29eb9ffe84b3b4a235bd1d1971cbe36e1f38dd13" end resource "scandir" do url "https://files.pythonhosted.org/packages/bd/f4/3143e0289faf0883228017dbc6387a66d0b468df646645e29e1eb89ea10e/scandir-1.5.tar.gz" sha256 "c2612d1a487d80fb4701b4a91ca1b8f8a695b1ae820570815e85e8c8b23f1283" end resource "six" do url "https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz" sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a" end def install virtualenv_install_with_resources end def caveats; <<-EOS.undent 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" 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