84 lines
3.1 KiB
Ruby
84 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/19/b0/5a563805cd59ad99b46a82fad0008ff6d9b55b61db88d8839b448c45b63c/thefuck-3.29.tar.gz"
|
|
sha256 "7b907b6ef6863cc0d3e9bb3e573054547a60f89572250b767ccadb317d3c8297"
|
|
revision 2
|
|
head "https://github.com/nvbn/thefuck.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "0a822134480ccd55e4205981e40d087b22ef54997f3c552139cbe80b2bbe24af" => :catalina
|
|
sha256 "6148a67e60772143a89ba87beb4715d88218ea21b40f85495ffa6b1b53e3b65f" => :mojave
|
|
sha256 "8f051631681251d562de831c82ea46f586b031de242ccc73517e6943d301bb74" => :high_sierra
|
|
end
|
|
|
|
depends_on "python@3.8"
|
|
|
|
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
|