2017-06-20 16:26:52 +00:00
|
|
|
class Goose < Formula
|
|
|
|
desc "Go Language's command-line interface for database migrations"
|
|
|
|
homepage "https://github.com/pressly/goose"
|
2017-07-22 04:52:19 +00:00
|
|
|
url "https://github.com/pressly/goose/archive/v2.1.0.tar.gz"
|
|
|
|
sha256 "c5dcfab9b726e3ab4847ae1ab7dc7e3563623f2e0f815b350d7a87d40c3b161f"
|
2017-06-20 16:26:52 +00:00
|
|
|
|
2017-07-21 09:20:12 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2017-08-03 06:39:22 +00:00
|
|
|
rebuild 1
|
|
|
|
sha256 "048326604ea253142be6c5bd21b72f3be66cc8f26183f6d7ab1e51866e95a5ec" => :sierra
|
|
|
|
sha256 "197a608d181b78f982397bf31793669f7b7817c4f4f9a59b390afb674723f2c8" => :el_capitan
|
|
|
|
sha256 "5e53a301723864fef1e9c79b7e54d94e0da557feacac24869bb6981111ddd3b3" => :yosemite
|
2017-07-21 09:20:12 +00:00
|
|
|
end
|
|
|
|
|
2017-08-03 06:33:14 +00:00
|
|
|
depends_on "dep" => :build
|
2017-06-20 16:26:52 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
(buildpath/"src/github.com/pressly/goose").install buildpath.children
|
|
|
|
cd "src/github.com/pressly/goose" do
|
2017-08-03 06:33:14 +00:00
|
|
|
system "dep", "ensure"
|
2017-06-20 16:26:52 +00:00
|
|
|
system "go", "build", "-o", bin/"goose", ".../cmd/goose"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
output = shell_output("#{bin}/goose sqlite3 foo.db status create")
|
|
|
|
assert_match "Migration", output
|
|
|
|
assert_predicate testpath/"foo.db", :exist?, "Failed to create foo.db!"
|
|
|
|
end
|
|
|
|
end
|