PageRenderTime 51ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/Formula/ripgrep.rb

https://repo.or.cz/Homebrew/homebrew-core.git
Ruby | 42 lines | 34 code | 6 blank | 2 comment | 0 complexity | bc41dda1db9734aee9ca743d60b3df74 MD5 | raw file
  1. class Ripgrep < Formula
  2. desc "Search tool like grep and The Silver Searcher"
  3. homepage "https://github.com/BurntSushi/ripgrep"
  4. url "https://github.com/BurntSushi/ripgrep/archive/12.0.1.tar.gz"
  5. sha256 "5be34aa77a36ac9d8f1297a0d97069e4653e03f61c67d192cee32944cd2b6329"
  6. head "https://github.com/BurntSushi/ripgrep.git"
  7. bottle do
  8. cellar :any
  9. sha256 "61b5686741206e584aa2f94746ecdd68bea29ad381b2a6c0ce2076cacb8408ca" => :catalina
  10. sha256 "1203664c55ee33d9b668cc9e8f4fe06b2cfe48ae7bc1374b3576104defc279ac" => :mojave
  11. sha256 "7a0ff676fe9bfc33f3c4279856c45238e3cc61a396cbd5e266d23796a5003e72" => :high_sierra
  12. end
  13. depends_on "asciidoc" => :build
  14. depends_on "docbook-xsl" => :build
  15. depends_on "pkg-config" => :build
  16. depends_on "rust" => :build
  17. depends_on "pcre2"
  18. def install
  19. ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
  20. system "cargo", "install", "--locked",
  21. "--root", prefix,
  22. "--path", ".",
  23. "--features", "pcre2"
  24. # Completion scripts and manpage are generated in the crate's build
  25. # directory, which includes a fingerprint hash. Try to locate it first
  26. out_dir = Dir["target/release/build/ripgrep-*/out"].first
  27. man1.install "#{out_dir}/rg.1"
  28. bash_completion.install "#{out_dir}/rg.bash"
  29. fish_completion.install "#{out_dir}/rg.fish"
  30. zsh_completion.install "complete/_rg"
  31. end
  32. test do
  33. (testpath/"Hello.txt").write("Hello World!")
  34. system "#{bin}/rg", "Hello World!", testpath
  35. end
  36. end