81 lines
3.1 KiB
Ruby
81 lines
3.1 KiB
Ruby
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/3e/ea/382d0be542567c5a20f39e733be3f6c3ad52ca762ae79b677e4b1be14b50/thefuck-3.23.tar.gz"
|
|
sha256 "646aa5affc55968d96a6bbef44344e320337f4deebe35627be5c80221053ae4f"
|
|
head "https://github.com/nvbn/thefuck.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "9eafb555f277a71ac7d74cba4c0d97743586975e90d1c380da3007183bea7674" => :sierra
|
|
sha256 "ae12c46579ecdd7d7e154a06e7f3f0fd474a837bbd3db78df43c86115d92ba5d" => :el_capitan
|
|
sha256 "6abce9bef21cdb243b9f57267a9cbae50a1b7ed22df371ed34350bae17731af8" => :yosemite
|
|
end
|
|
|
|
depends_on :python3
|
|
|
|
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/bb/e0/f6e41e9091e130bf16d4437dabbac3993908e4d6485ecbc985ef1352db94/decorator-4.1.2.tar.gz"
|
|
sha256 "7cb64d38cb8002971710c8899fbdfb859a23a364b7c99dab19d1f719c2ba16b5"
|
|
end
|
|
|
|
resource "psutil" do
|
|
url "https://files.pythonhosted.org/packages/57/93/47a2e3befaf194ccc3d05ffbcba2cdcdd22a231100ef7e4cf63f085c900b/psutil-5.2.2.tar.gz"
|
|
sha256 "44746540c0fab5b95401520d29eb9ffe84b3b4a235bd1d1971cbe36e1f38dd13"
|
|
end
|
|
|
|
resource "pyte" do
|
|
url "https://files.pythonhosted.org/packages/20/8b/7d6fc4ccc1dda496ab55b7f4ed1907392d6c2f98057f77be2bd07018987e/pyte-0.6.0.tar.gz"
|
|
sha256 "cd99a50070dcdb59678e7adc52696e8de8d1972e87808574fd8a243f78a8b462"
|
|
end
|
|
|
|
resource "six" do
|
|
url "https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"
|
|
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
|
|
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.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"
|
|
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
|