2015-02-09 21:26:40 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Vegeta < Formula
|
|
|
|
homepage "https://github.com/tsenart/vegeta"
|
2015-04-16 16:57:39 +00:00
|
|
|
url "https://github.com/tsenart/vegeta/archive/v5.6.3.tar.gz"
|
|
|
|
sha1 "f20a34040319724e9bb9a1ad630f9eb1f4231073"
|
2015-02-09 21:26:40 +00:00
|
|
|
|
2015-02-19 16:43:49 +00:00
|
|
|
bottle do
|
2015-02-20 15:38:23 +00:00
|
|
|
cellar :any
|
2015-04-17 23:13:39 +00:00
|
|
|
sha256 "d4a3eabe14e2bd901f6e11429343cc759db9e527adf22f03ce20e7ca6cbd9148" => :yosemite
|
|
|
|
sha256 "2005307d4b6a4c98ff564225692cae26c70f0f68d72ad6321ae6bb646b4bdb94" => :mavericks
|
|
|
|
sha256 "8b54aff2e4b930ea3253ed5022a028e0a4af64d34a75a5a26b4b9128cbe0ba39" => :mountain_lion
|
2015-02-19 16:43:49 +00:00
|
|
|
end
|
|
|
|
|
2015-02-09 21:26:40 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
go_resource "github.com/bmizerany/perks" do
|
|
|
|
url "https://github.com/bmizerany/perks.git",
|
|
|
|
:revision => "6cb9d9d729303ee2628580d9aec5db968da3a607"
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
mkdir_p buildpath/"src/github.com/tsenart/"
|
|
|
|
ln_s buildpath, buildpath/"src/github.com/tsenart/vegeta"
|
|
|
|
ENV["GOPATH"] = buildpath
|
2015-04-16 16:57:39 +00:00
|
|
|
ENV["CGO_ENABLED"] = "0"
|
2015-02-09 21:26:40 +00:00
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
|
2015-04-16 16:57:39 +00:00
|
|
|
system "go", "build", "-ldflags", "-X main.Version v5.6.3", "-o", "vegeta"
|
2015-02-09 21:26:40 +00:00
|
|
|
bin.install "vegeta"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-04-16 16:57:39 +00:00
|
|
|
pipe_output("#{bin}/vegeta attack -duration=1s -rate=1 | #{bin}/vegeta report", "GET http://localhost/")
|
2015-02-09 21:26:40 +00:00
|
|
|
end
|
|
|
|
end
|