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/dd/3e/2bc73f9afc583e6ce090afa630e7a5e676be85d211bcf192bbce2e2283c4/thefuck-3.17.tar.gz" sha256 "e84a08129743520f7fdcc5bfabd55866197260c822af37e347fe1ababbd9568f" head "https://github.com/nvbn/thefuck.git" bottle do cellar :any_skip_relocation sha256 "185410e985df5fecaec62799461d27b3c830a0ae07ad2a4c022fdd5b8bc7cd56" => :sierra sha256 "ae799a2900825330c5652e4b6c407528fc2f0246fda06e0d13eb45cfce247b66" => :el_capitan sha256 "2bdaa6da42d0d3b5f8ef6f39b7931f2d2751c9b74bb3abafdb8ac7194abf2e74" => :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