2014-05-07 22:59:45 +00:00
|
|
|
class Pgformatter < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "PostgreSQL syntax beautifier"
|
2014-05-07 22:59:45 +00:00
|
|
|
homepage "http://sqlformat.darold.net/"
|
2015-04-19 18:05:56 +00:00
|
|
|
url "https://github.com/darold/pgFormatter/archive/v1.4.tar.gz"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "d8bb04f1f0d35cbae9aeb8ae91273f3d13ce07305226605c1b2db161010bedc9"
|
2014-05-07 22:59:45 +00:00
|
|
|
|
|
|
|
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
|
2015-08-03 12:55:31 +00:00
|
|
|
test_file = (testpath/"test.sql")
|
|
|
|
test_file.write("SELECT * FROM foo")
|
2014-05-07 22:59:45 +00:00
|
|
|
system "#{bin}/pg_format", test_file
|
|
|
|
end
|
|
|
|
end
|