2015-02-09 21:26:40 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Vegeta < Formula
|
|
|
|
homepage "https://github.com/tsenart/vegeta"
|
2015-03-23 19:18:59 +00:00
|
|
|
url "https://github.com/tsenart/vegeta/archive/v5.6.1.tar.gz"
|
|
|
|
sha1 "9b1455423c0b87fcf6e3ea65b3e6ba89c687700d"
|
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-03-23 21:07:33 +00:00
|
|
|
sha256 "2f1c99d31c3180395d1303fe86e731e11b72b86bc5ead5230e60ef8976f9e0d5" => :yosemite
|
|
|
|
sha256 "05030e85e6aad70e4b995fb69c43502ee910d4031a91d6a7593d5816605f435a" => :mavericks
|
|
|
|
sha256 "ceab3a9212a6e1175e0b0221233cf13ee55b6ffadde0e3605ed858208f86548b" => :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
|
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
|
|
|
|
system "go", "build", "-o", "vegeta"
|
|
|
|
bin.install "vegeta"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
pipe_output("#{bin}/vegeta attack -duration=1s -rate=1", "GET http://localhost/")
|
|
|
|
end
|
|
|
|
end
|