2011-09-28 10:58:48 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Csvprintf < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Command-line utility for parsing CSV files"
|
2011-09-28 10:58:48 +00:00
|
|
|
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
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "Fred Smith\n",
|
|
|
|
pipe_output("#{bin}/csvprintf -i '%2$s %1$s\n'", "Last,First\nSmith,Fred\n")
|
2014-02-10 23:59:52 +00:00
|
|
|
end
|
2011-09-28 10:58:48 +00:00
|
|
|
end
|