diff options
| author | Alexis Hildebrandt | 2015-01-06 20:47:22 +0100 |
|---|---|---|
| committer | Jack Nagel | 2015-01-12 21:08:21 -0500 |
| commit | 85c497b71fd2ee74ced8dfc1f4413f71824f15d6 (patch) | |
| tree | f009d603b18e644e3123aa9e28ee8c351fe4cdf0 /Library | |
| parent | 3a5676042b3eace57a0c9843272409ad64bef213 (diff) | |
| download | homebrew-85c497b71fd2ee74ced8dfc1f4413f71824f15d6.tar.bz2 | |
lout: modernize
* Remove obsolete require 'formula'
* Replace single quotes with double quotes
* Split system argument string
* Set make variables on system command
* Add test
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/lout.rb | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Library/Formula/lout.rb b/Library/Formula/lout.rb index 872242790..08344582b 100644 --- a/Library/Formula/lout.rb +++ b/Library/Formula/lout.rb @@ -1,20 +1,24 @@ -require 'formula' - class Lout < Formula - homepage 'http://savannah.nongnu.org/projects/lout' - url 'http://download.savannah.gnu.org/releases/lout/lout-3.40.tar.gz' - sha1 'adb7f632202319a370eaada162fa52cf334f40b3' + homepage "https://savannah.nongnu.org/projects/lout" + url "http://download.savannah.gnu.org/releases/lout/lout-3.40.tar.gz" + sha1 "adb7f632202319a370eaada162fa52cf334f40b3" def install - inreplace "makefile" do |s| - s.change_make_var! "PREFIX", prefix - s.change_make_var! "LOUTLIBDIR", lib - s.change_make_var! "LOUTDOCDIR", doc - s.change_make_var! "MANDIR", man1 - end bin.mkpath man1.mkpath - (doc/'lout').mkpath - system "make allinstall" + (doc/"lout").mkpath + system "make", "PREFIX=#{prefix}", "LOUTLIBDIR=#{lib}", "LOUTDOCDIR=#{doc}", "MANDIR=#{man}", "allinstall" + end + + test do + input = "test.lout" + (testpath/input).write <<-EOS.undent + @SysInclude { doc } + @Doc @Text @Begin + @Display @Heading { Blindtext } + The quick brown fox jumps over the lazy dog. + @End @Text + EOS + assert_match /^\s+Blindtext\s+The quick brown fox.*\n+$/, shell_output("#{bin}/lout -p #{input}") end end |
