homebrew-core/Formula/rbspy.rb
2019-11-03 10:59:13 +09:00

36 lines
1.4 KiB
Ruby

class Rbspy < Formula
desc "Sampling profiler for Ruby"
homepage "https://rbspy.github.io/"
url "https://github.com/rbspy/rbspy/archive/v0.3.7.tar.gz"
sha256 "cc9262eec63e8fbb24f2926f27afee20c7cd9695fefad0804dc0272c99b410b8"
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "9c294a02b723e6447e8d768dd14cef97bc9cee25c8541805c3e9da92bdf8dc2b" => :catalina
sha256 "8ee146850f9552d9d81ae467cf0418e12899916f4e143e29a0d85691f099ecb8" => :mojave
sha256 "a2a5d8cc114f60f72072ba283faa5ffc862696c76e8d849d191950de6136477a" => :high_sierra
end
depends_on "rust" => :build
def install
system "cargo", "install", "--locked", "--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