pyinvoke 0.13.0 (new formula)
Closes #5279. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
1a29060809
commit
a6719b1c5a
1 changed files with 37 additions and 0 deletions
37
Formula/pyinvoke.rb
Normal file
37
Formula/pyinvoke.rb
Normal file
|
@ -0,0 +1,37 @@
|
|||
class Pyinvoke < Formula
|
||||
include Language::Python::Virtualenv
|
||||
|
||||
desc "Pythonic task management & command execution"
|
||||
homepage "http://pyinvoke.org/"
|
||||
url "https://github.com/pyinvoke/invoke/archive/0.13.0.tar.gz"
|
||||
sha256 "4942aa901618f99afa70271d7b15fd018da0f174178fbca4048354c785e7736a"
|
||||
head "https://github.com/pyinvoke/invoke.git"
|
||||
|
||||
depends_on :python if MacOS.version <= :snow_leopard
|
||||
|
||||
def install
|
||||
virtualenv_install_with_resources
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"tasks.py").write <<-EOS.undent
|
||||
from invoke import run, task
|
||||
|
||||
@task
|
||||
def clean(ctx, extra=''):
|
||||
patterns = ['foo']
|
||||
if extra:
|
||||
patterns.append(extra)
|
||||
for pattern in patterns:
|
||||
run("rm -rf {}".format(pattern))
|
||||
EOS
|
||||
(testpath/"foo"/"bar").mkpath
|
||||
(testpath/"baz").mkpath
|
||||
system bin/"invoke", "clean"
|
||||
assert !File.exist?(testpath/"foo"), "\"pyinvoke clean\" should have deleted \"foo\""
|
||||
assert File.exist?(testpath/"baz"), "pyinvoke should have left \"baz\""
|
||||
system bin/"invoke", "clean", "--extra=baz"
|
||||
assert !File.exist?(testpath/"foo"), "\"pyinvoke clean-extra\" should have still deleted \"foo\""
|
||||
assert !File.exist?(testpath/"baz"), "pyinvoke clean-extra should have deleted \"baz\""
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue