Skip to content

Instantly share code, notes, and snippets.

@joallard
Created October 13, 2016 18:24
Show Gist options
  • Save joallard/11a97b2ee3eed44f1a93690fecdfe92a to your computer and use it in GitHub Desktop.
Save joallard/11a97b2ee3eed44f1a93690fecdfe92a to your computer and use it in GitHub Desktop.
pgfutter brew formula
require "language/go"
class Pgfutter < Formula
desc "Import CSV and JSON into PostgreSQL the easy way"
homepage "https://github.com/lukasmartinelli/pgfutter"
url "https://github.com/lukasmartinelli/pgfutter.git", :tag => "v1.1"
sha256 ""
depends_on "go" => :build
go_resource "golang.org/x/net" do
url "https://go.googlesource.com/net.git"
end
go_resource "github.com/cheggaaa/pb" do
url "https://github.com/cheggaaa/pb.git"
end
go_resource "github.com/lib/pq" do
url "https://github.com/lib/pq.git"
end
go_resource "github.com/kennygrant/sanitize" do
url "https://github.com/kennygrant/sanitize.git"
end
go_resource "github.com/codegangsta/cli" do
url "https://github.com/codegangsta/cli.git"
end
def install
ENV["GOPATH"] = buildpath
Language::Go.stage_deps resources, buildpath/"src"
system "go", "build", "-o", bin/"pgfutter"
end
test do
# `test do` will create, run in and delete a temporary directory.
#
# This test will fail and we won't accept that! It's enough to just replace
# "false" with the main program this formula installs, but it'd be nice if you
# were more thorough. Run the test with `brew test pgfutter`. Options passed
# to `brew install` such as `--HEAD` also need to be provided to `brew test`.
#
# The installed folder is not in the path, so use the entire path to any
# executables being tested: `system "#{bin}/program", "do", "something"`.
system "#{bin}/pgfutter", "--help"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment