2015-08-23 16:23:43 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Gor < Formula
|
|
|
|
desc "Real-time HTTP traffic replay tool written in Go"
|
2016-05-25 13:27:33 +00:00
|
|
|
homepage "https://gortool.com"
|
2016-06-11 13:47:22 +00:00
|
|
|
url "https://github.com/buger/gor/archive/v0.14.1.tar.gz"
|
|
|
|
sha256 "802c253fd5218e914e707afb7f3b79baa54871160c4085b949ef3855abfb86d5"
|
2015-08-23 16:23:43 +00:00
|
|
|
head "https://github.com/buger/gor.git"
|
|
|
|
|
2015-08-25 20:07:31 +00:00
|
|
|
bottle do
|
2015-10-29 09:49:24 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-06-11 13:56:18 +00:00
|
|
|
sha256 "09bc8e6d7411acf4938005f0d53ab4ebbb8b7e334d03c8bc722bf392a236cf85" => :el_capitan
|
|
|
|
sha256 "3c790b1f23a5977c1d03a47df86e3c5bf906882283122fe3ae7fabb3d24c8406" => :yosemite
|
|
|
|
sha256 "a5513e92344941dcc5d683dc56b7e37897df1c4729007d38f988cfeb690fd615" => :mavericks
|
2015-08-25 20:07:31 +00:00
|
|
|
end
|
|
|
|
|
2015-08-23 16:23:43 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
go_resource "github.com/bitly/go-hostpool" do
|
2015-10-29 09:44:40 +00:00
|
|
|
url "https://github.com/bitly/go-hostpool.git",
|
|
|
|
:revision => "d0e59c22a56e8dadfed24f74f452cea5a52722d2"
|
2015-08-23 16:23:43 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/buger/elastigo" do
|
2015-10-29 09:44:40 +00:00
|
|
|
url "https://github.com/buger/elastigo.git",
|
|
|
|
:revision => "23fcfd9db0d8be2189a98fdab77a4c90fcc3a1e9"
|
2015-08-23 16:23:43 +00:00
|
|
|
end
|
|
|
|
|
2016-05-25 13:27:33 +00:00
|
|
|
go_resource "github.com/google/gopacket" do
|
|
|
|
url "https://github.com/google/gopacket.git",
|
2016-06-11 13:47:22 +00:00
|
|
|
:revision => "f4807986c9ee46845a35c59a382d6ccd9304b320"
|
2016-05-25 13:27:33 +00:00
|
|
|
end
|
|
|
|
|
2015-08-23 16:23:43 +00:00
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
2016-06-11 13:47:22 +00:00
|
|
|
(buildpath/"src/github.com/buger").mkpath
|
2015-08-23 16:23:43 +00:00
|
|
|
ln_sf buildpath, buildpath/"src/github.com/buger/gor"
|
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
|
2016-06-11 13:47:22 +00:00
|
|
|
system "go", "build", "-o", bin/"gor", "-ldflags", "-X main.VERSION=#{version}"
|
2015-08-23 16:23:43 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-10-29 09:44:40 +00:00
|
|
|
assert_match version.to_s, shell_output("#{bin}/gor", 1)
|
2015-08-23 16:23:43 +00:00
|
|
|
end
|
|
|
|
end
|