noweb: fix url, add test

- also add comment about new url for the next version
This commit is contained in:
Viktor Szakats 2018-10-23 16:38:49 +00:00 committed by Viktor Szakats
parent 8eb7ac11ae
commit 33294dd6c0

View file

@ -1,9 +1,8 @@
class Noweb < Formula
desc "WEB-like literate-programming tool"
homepage "https://www.cs.tufts.edu/~nr/noweb/"
url "ftp://www.eecs.harvard.edu/pub/nr/noweb.tgz"
mirror "https://mirrors.ocf.berkeley.edu/debian/pool/main/n/noweb/noweb_2.11b.orig.tar.gz"
version "2.11b"
# new canonical url (for newer versions): http://mirrors.ctan.org/web/noweb.zip
url "https://deb.debian.org/debian/pool/main/n/noweb/noweb_2.11b.orig.tar.gz"
sha256 "c913f26c1edb37e331c747619835b4cade000b54e459bb08f4d38899ab690d82"
bottle do
@ -54,4 +53,43 @@ class Noweb < Formula
You may need to add the directory to TEXINPUTS to run noweb properly.
EOS
end
test do
(testpath/"test.nw").write <<~EOS
\section{Hello world}
Today I awoke and decided to write
some code, so I started to write Hello World in \textsf C.
<<hello.c>>=
/*
<<license>>
*/
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello World!\n");
return 0;
}
@
\noindent \ldots then I did the same in PHP.
<<hello.php>>=
<?php
/*
<<license>>
*/
echo "Hello world!\n";
?>
@
\section{License}
Later the same day some lawyer reminded me about licenses.
So, here it is:
<<license>>=
This work is placed in the public domain.
EOS
assert_match "this file was generated automatically by noweave",
shell_output("#{bin}/noweave -filter l2h -index -html test.nw | #{bin}/htmltoc")
end
end