sql-translator 0.11021 (new formula)

Closes #5020.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Jiangge Zhang 2016-09-20 19:04:37 +08:00 committed by Mike McQuaid
parent ccacc69a63
commit 5973cb4043

30
Formula/sql-translator.rb Normal file
View file

@ -0,0 +1,30 @@
class SqlTranslator < Formula
desc "Manipulate structured data definitions (SQL and more)"
homepage "https://github.com/dbsrgits/sql-translator/"
url "https://cpan.metacpan.org/authors/id/I/IL/ILMARI/SQL-Translator-0.11021.tar.gz"
sha256 "64cb38a9f78367bc115359a999003bbeb3c32cc75bba8306ec1a938fc441bfd1"
def install
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
ENV["PERL_MM_OPT"] = "INSTALL_BASE=#{libexec}"
system "perl", "Makefile.PL", "--defaultdeps"
system "make", "install"
bin.install Dir["#{libexec}/bin/sqlt*"]
man1.install Dir["#{libexec}/man/man1/sqlt*.1"]
bin.env_script_all_files libexec/"bin", :PERL5LIB => ENV["PERL5LIB"]
end
test do
command = "#{bin}/sqlt -f MySQL -t PostgreSQL --no-comments -"
sql_input = "create table sqlt ( id int AUTO_INCREMENT );"
sql_output = <<-EOS.undent
CREATE TABLE "sqlt" (
"id" serial
);
EOS
assert_equal sql_output, pipe_output(command, sql_input)
end
end