homebrew-core/Formula/topgrade.rb
2019-11-19 09:31:33 -05:00

37 lines
1.3 KiB
Ruby

class Topgrade < Formula
desc "Upgrade all the things"
homepage "https://github.com/r-darwish/topgrade"
url "https://github.com/r-darwish/topgrade/archive/v3.4.0.tar.gz"
sha256 "8dc0357f031e5ffb941f57750293540ec41ac1f0453774d3d2a031ef0e47a8e3"
bottle do
cellar :any_skip_relocation
sha256 "6bd7fa1fc8760f53a10424a44971fe20e9f30b24d708b8ff4b472cec7e873975" => :catalina
sha256 "e0ac6383b65b4613ab9310a7d43c503d5144a804ab3b53018bb249713de6aeeb" => :mojave
sha256 "35101c9a7156057916cabccf5cf5bbb07acb227976cfd4ae88d957ec2ebc1811" => :high_sierra
end
depends_on "rust" => :build
def install
system "cargo", "install", "--locked", "--root", prefix, "--path", "."
end
test do
# Configuraton path details: https://github.com/r-darwish/topgrade/blob/master/README.md#configuration-path
# Sample config file: https://github.com/r-darwish/topgrade/blob/master/config.example.toml
(testpath/"Library/Preferences/topgrade.toml").write <<~EOS
# Additional git repositories to pull
#git_repos = [
# "~/src/*/",
# "~/.config/something"
#]
EOS
assert_match version.to_s, shell_output("#{bin}/topgrade --version")
output = shell_output("#{bin}/topgrade -n")
assert_match "Dry running: #{HOMEBREW_PREFIX}/bin/brew upgrade", output
assert_not_match /\sSelf update\s/, output
end
end