aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/pgformatter.rb
blob: 6b90db5c1e7b38f547fd7664d292347a116ba6e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "formula"

class Pgformatter < Formula
  homepage "http://sqlformat.darold.net/"
  url "https://downloads.sourceforge.net/project/pgformatter/1.2/pgFormatter-1.2.tar.gz"
  sha1 "598c39fa7f3f511aa376e7a18457139a9393fe74"

  def install
    system "perl", "Makefile.PL", "DESTDIR=."
    system "make", "install"
    bin.install "blib/script/pg_format"
    man1.install "blib/man1/pg_format.1"
  end

  test do
    test_file = (testpath/'test.sql')
    test_file.write('SELECT * FROM foo')
    system "#{bin}/pg_format", test_file
  end
end