Skip to content

Commit fa192e8

Browse files
authored
Merge pull request #233284 from Homebrew/cogapp-new-formula
cogapp 5.3.1 (new formula)
2 parents 133ff76 + d39cc69 commit fa192e8

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Formula/c/cogapp.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
class Cogapp < Formula
2+
include Language::Python::Virtualenv
3+
4+
desc "Small bits of Python computation for static files"
5+
homepage "https://cog.readthedocs.io/en/latest/"
6+
url "https://files.pythonhosted.org/packages/27/04/395d2067e7cb2e0c847dad74ef6048ce9cdf2c77c7add3805485455ac288/cogapp-3.5.1.tar.gz"
7+
sha256 "a9e8b8c31e5e47de722f27eaba1ec128dd6c8e7b6015555d9c8edaa5ad6092b4"
8+
license "MIT"
9+
10+
bottle do
11+
sha256 cellar: :any_skip_relocation, all: "a904c26976e9e55216ce6316e12727825dd8fdda8b4a762be8a6632efe60d172"
12+
end
13+
14+
depends_on "[email protected]"
15+
16+
def install
17+
virtualenv_install_with_resources
18+
end
19+
20+
test do
21+
assert_match version.to_s, shell_output("#{bin}/cog -v")
22+
23+
(testpath/"test.cpp").write <<~CPP
24+
/*[[[cog
25+
import cog
26+
fnames = ['DoSomething', 'DoAnotherThing', 'DoLastThing']
27+
for fn in fnames:
28+
cog.outl("void %s();" % fn)
29+
]]]*/
30+
//[[[end]]]
31+
CPP
32+
33+
output = shell_output("#{bin}/cog test.cpp")
34+
assert_match "void DoSomething();\nvoid DoAnotherThing();\nvoid DoLastThing();", output
35+
end
36+
end

0 commit comments

Comments
 (0)