From 4a9ba47b86765f7deb1d10f7a16cf3260a18d812 Mon Sep 17 00:00:00 2001 From: Pablo Santiago Blum de Aguiar Date: Tue, 21 Jul 2015 22:58:13 -0300 Subject: [PATCH] thefuck 2.3 Closes Homebrew/homebrew#41997. Signed-off-by: Dominyk Tiller --- Formula/thefuck.rb | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Formula/thefuck.rb b/Formula/thefuck.rb index 9467dff7cc..f2729262de 100644 --- a/Formula/thefuck.rb +++ b/Formula/thefuck.rb @@ -1,8 +1,8 @@ class Thefuck < Formula desc "Programatically correct mistyped console commands" homepage "https://github.com/nvbn/thefuck" - url "https://pypi.python.org/packages/source/t/thefuck/thefuck-1.48.tar.gz" - sha256 "cc64016e6740a16221e2ec8dd752849b1876f69dc23b094bf5ea9d03e536ec59" + url "https://pypi.python.org/packages/source/t/thefuck/thefuck-2.3.tar.gz" + sha256 "260da6b4c698871098f9939a88deedbb0761e72c2096ef3e25cb7773156cd0c0" head "https://github.com/nvbn/thefuck.git" @@ -35,13 +35,21 @@ class Thefuck < Formula sha256 "e24052411fc4fbd1f672635537c3fc2330d9481b18c0317695b46259512c91d5" end - def install - ENV["PYTHONPATH"] = libexec/"vendor/lib/python2.7/site-packages" - ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages" + resource "setuptools" do + url "https://pypi.python.org/packages/source/s/setuptools/setuptools-18.0.1.tar.gz" + sha256 "4d49c99fd51edf22baa997fb6105b07482feaebcb174b7d348a4307c29264b94" + end - resources.each do |r| - r.stage { system "python", *Language::Python.setup_install_args(libexec/"vendor") } + def install + xy = Language::Python.major_minor_version "python" + ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages" + %w[setuptools pathlib psutil colorama six].each do |r| + resource(r).stage do + system "python", *Language::Python.setup_install_args(libexec/"vendor") + end end + + ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages" system "python", *Language::Python.setup_install_args(libexec) bin.install Dir["#{libexec}/bin/*"] @@ -49,16 +57,14 @@ class Thefuck < Formula end def caveats; <<-EOS.undent - Add the following to your .bash_profile or .zshrc: - bash: alias fuck='eval $(thefuck $(fc -ln -1)); history -r' - zsh: alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R' + Add the following to your .bash_profile, .bashrc or .zshrc: + bash: eval "$(thefuck-alias)" Other shells: https://github.com/nvbn/thefuck/wiki/Shell-aliases EOS end test do - output = shell_output(bin/"thefuck echho") - assert output.include? "echo" + assert_match /echo ok/, shell_output(bin/"thefuck echho ok") end end