2011-11-21 21:21:08 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class NewickUtils < Formula
|
|
|
|
homepage 'http://cegg.unige.ch/newick_utils'
|
2013-01-28 06:07:55 +00:00
|
|
|
url 'http://cegg.unige.ch/pub/newick-utils-1.6.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 'a9779054dcbf957618458ebfed07991fabeb3e19'
|
2011-11-21 21:21:08 +00:00
|
|
|
|
|
|
|
def patches
|
|
|
|
# don't bother testing nw_gen, it's known to fail on MacOSX
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
|
|
|
system "make"
|
|
|
|
system "make check"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
|
2013-03-26 16:24:42 +00:00
|
|
|
test do
|
|
|
|
require 'open3'
|
|
|
|
|
|
|
|
expected = <<-EOS
|
|
|
|
+-------------------------------------+ B
|
|
|
|
=| A
|
|
|
|
+---------------------------------------------------------------------------+ C
|
|
|
|
|
|
|
|
|------------------|------------------|------------------|------------------|
|
|
|
|
0 0.5 1 1.5 2
|
|
|
|
substitutions/site
|
|
|
|
EOS
|
|
|
|
|
|
|
|
Open3.popen3("#{bin}/nw_display", "-") do |stdin, stdout, _|
|
|
|
|
stdin.write("(B:1,C:2)A;\n")
|
|
|
|
stdin.close
|
2013-06-09 02:26:24 +00:00
|
|
|
assert_equal expected, stdout.read.split("\n").map(&:rstrip).join("\n")
|
2013-03-26 16:24:42 +00:00
|
|
|
end
|
2011-11-21 21:21:08 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
|
|
|
--- a/tests/test_nw_gen.sh
|
|
|
|
+++ b/tests/test_nw_gen.sh
|
2011-11-30 21:16:49 +00:00
|
|
|
@@ -138,0 +139,2 @@
|
2011-11-21 21:21:08 +00:00
|
|
|
+pass=TRUE
|
|
|
|
+
|