blob: 930deeeb0daaf26f2ad9b6304bfcbb15dc3455fe (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 | require 'formula'
class Csvprintf < Formula
  homepage 'http://code.google.com/p/csvprintf/'
  url 'https://csvprintf.googlecode.com/files/csvprintf-1.0.3.tar.gz'
  sha1 'ee5ee6728a44cc7d0961b0960c7a444372752931'
  def install
    ENV.append 'LDFLAGS', '-liconv'
    system "./configure", "--disable-debug", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    system "make install"
  end
  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
end
 |