2011-09-28 10:58:48 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Csvprintf < Formula
|
|
|
|
homepage 'http://code.google.com/p/csvprintf/'
|
2014-03-05 07:22:08 +00:00
|
|
|
url 'https://csvprintf.googlecode.com/files/csvprintf-1.0.3.tar.gz'
|
2013-02-05 13:56:18 +00:00
|
|
|
sha1 'ee5ee6728a44cc7d0961b0960c7a444372752931'
|
2011-09-28 10:58:48 +00:00
|
|
|
|
|
|
|
def install
|
2013-02-05 13:56:18 +00:00
|
|
|
ENV.append 'LDFLAGS', '-liconv'
|
2012-02-13 06:11:43 +00:00
|
|
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
2011-09-28 10:58:48 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2014-02-10 23:59:52 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
IO.popen("#{bin}/csvprintf -i '%2$s %1$s\n'", "w+") do |pipe|
|
|
|
|
pipe.write "Last,First\nSmith,Fred\n"
|
|
|
|
pipe.close_write
|
|
|
|
assert_equal "Fred Smith\n", pipe.read
|
|
|
|
end
|
|
|
|
end
|
2011-09-28 10:58:48 +00:00
|
|
|
end
|