class Eralchemy < Formula include Language::Python::Virtualenv desc "Simple entity relation (ER) diagrams generation" homepage "https://github.com/Alexis-benoist/eralchemy" url "https://files.pythonhosted.org/packages/87/40/07b58c29406ad9cc8747e567e3e37dd74c0a8756130ad8fd3a4d71c796e3/ERAlchemy-1.2.10.tar.gz" sha256 "be992624878278195c3240b90523acb35d97453f1a350c44b4311d4333940f0d" bottle do cellar :any sha256 "f94720536c124634d8ffd602459dfca472367deb61ba95258960a0a3bfbae0be" => :high_sierra sha256 "4dea4cbf9c81590fef898ae6cc6fc7ad4a1552e843f0cd8c21830de044bda64f" => :sierra sha256 "9bd0f4f745b3934599ac0b4286aa96202b3610e224630ecd5fc0870cf23f9d2f" => :el_capitan end depends_on "python@2" depends_on "pkg-config" => :build depends_on "graphviz" depends_on "openssl" depends_on "postgresql" => :optional resource "pygraphviz" do url "https://files.pythonhosted.org/packages/98/bb/a32e33f7665b921c926209305dde66fe41003a4ad934b10efb7c1211a419/pygraphviz-1.3.1.tar.gz" sha256 "7c294cbc9d88946be671cc0d8602aac176d8c56695c0a7d871eadea75a958408" end resource "SQLAlchemy" do url "https://files.pythonhosted.org/packages/f3/b7/d8725042f105cc6b71c7bae0ffd46e49f762e5a08f421f1eddd855a1f723/SQLAlchemy-1.2.4.tar.gz" sha256 "6997507af46b10630e13b605ac278b78885fd683d038896dbee0e7ec41d809d2" end resource "psycopg2" do url "https://files.pythonhosted.org/packages/74/83/51580322ed0e82cba7ad8e0af590b8fb2cf11bd5aaa1ed872661bd36f462/psycopg2-2.7.4.tar.gz" sha256 "8bf51191d60f6987482ef0cfe8511bbf4877a5aa7f313d7b488b53189cf26209" end resource "er_example" do url "https://raw.githubusercontent.com/Alexis-benoist/eralchemy/v1.1.0/example/newsmeme.er" sha256 "5c475bacd91a63490e1cbbd1741dc70a3435e98161b5b9458d195ee97f40a3fa" end def install venv = virtualenv_create(libexec) res = resources.map(&:name).to_set - ["er_example", "psycopg2"] res.each do |r| venv.pip_install resource(r) end venv.pip_install resource("psycopg2") if build.with? "postgresql" venv.pip_install_and_link buildpath end test do system "#{bin}/eralchemy", "-v" resource("er_example").stage do system "#{bin}/eralchemy", "-i", "newsmeme.er", "-o", "test_eralchemy.pdf" assert_predicate Pathname.pwd/"test_eralchemy.pdf", :exist? end end end