24 lines
686 B
Ruby
24 lines
686 B
Ruby
|
class Sqlparse < Formula
|
||
|
include Language::Python::Virtualenv
|
||
|
|
||
|
desc "Non-validating SQL parser"
|
||
|
homepage "https://github.com/andialbrecht/sqlparse"
|
||
|
url "https://files.pythonhosted.org/packages/55/ce/3944e990b03f80f36f0050b407ad46cde192a210d473f0d705b554bddd1d/sqlparse-0.2.2.tar.gz"
|
||
|
sha256 "d446296b2c26f9466860dd85fa32480bec523ab96bda8879262c38e8e8fbba21"
|
||
|
|
||
|
depends_on :python if MacOS.version <= :snow_leopard
|
||
|
|
||
|
def install
|
||
|
virtualenv_install_with_resources
|
||
|
end
|
||
|
|
||
|
test do
|
||
|
expected = <<-EOS.undent.chomp
|
||
|
select *
|
||
|
from foo
|
||
|
EOS
|
||
|
output = pipe_output("#{bin}/sqlformat - -a", "select * from foo", 0)
|
||
|
assert_equal expected, output
|
||
|
end
|
||
|
end
|