homebrew-core/Formula/rbspy.rb

35 lines
1.3 KiB
Ruby
Raw Normal View History

class Rbspy < Formula
desc "Sampling profiler for Ruby"
homepage "https://rbspy.github.io/"
url "https://github.com/rbspy/rbspy/archive/v0.3.3.tar.gz"
sha256 "15b8c43f3071e5ae5dad4920cbd6a743b8d6c64e0bc90e1ebe86db2fd79fb3e5"
2018-09-01 17:17:21 +00:00
bottle do
2018-11-19 05:19:11 +00:00
sha256 "a1e2f114f1143a82dacccaf2e072bfd5b50d43db1420f04e3e38f9f617e07234" => :mojave
sha256 "0fd3bc691b0cfaa3633b4ea64394baccfe44f106de184a4547d520acf66dcd01" => :high_sierra
sha256 "5a474af2c4275cb7acfde17647cfc21ceb713ebe5b49f5d586e9c4d02bf3c39c" => :sierra
2018-09-01 17:17:21 +00:00
end
depends_on "rust" => :build
def install
system "cargo", "install", "--root", prefix, "--path", "."
end
test do
recording = <<~EOS
H4sICCOlhlsAA2JyZXdfdGVzdF9yZXN1bHQAvdHBCsIwDAbgu08hOQ/nHKgM8S08iYy0Vlds0
5J2Dhl7d3eZTNxN8Rb4yf9BwiL4xzKbtRAZpYLi2AKh7QfYyfmlJhm1oz0kwMpg1HdVeoxVH9
d0I9dQn6AIztRxSKg2JgGjSZGDYtklr0ZEnCgKleNYenZXRrtg8dkI6SEoDmnlrEoFqyYNaL1
R70uDuBqJQogpcWL7K3I9IqWU/yCz8WF3FvXkk37P5t0pAa/PUOTbfLvpZk/I+tcWQgIAAA==
EOS
(testpath/"recording.gz").write Base64.decode64(recording.delete("\n"))
system "#{bin}/rbspy", "report", "-f", "summary", "-i", "recording.gz",
"-o", "result"
expected_result = "100.00 100.00 aaa - short_program.rb"
assert_includes File.read("result"), expected_result
end
end