Skip to content

Commit

Permalink
rip2 0.9.0 (new formula)
Browse files Browse the repository at this point in the history
provides maintained version of rip under new rip2 name

Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
bkaplowitz authored and chenrui333 committed Oct 31, 2024
1 parent 19d3f10 commit de1c53a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Formula/r/rip2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class Rip < Formula
desc "Safe and ergonomic alternative to rm"
homepage "https://github.com/MilesCranmer/rip2"
url "https://github.com/MilesCranmer/rip2/archive/refs/tags/v0.9.0.tar.gz"
sha256 "e8519e21877c8883f9f2a700036c53bce62b5ee0afaef47a12780999457e2633"
license "GPL-3.0-or-later"
head "https://github.com/MilesCranmer/rip2.git", branch: "master"

depends_on "rust" => :build

def install
system "cargo", "install", *std_cargo_args(path: ".")

generate_completions_from_executable(bin/"rip", "completion")
(share/"elvish/lib/rip.elv").write Utils.safe_popen_read(bin/"rip", "completions", "elvish")
(share/"powershell/completions/_rip.ps1").write Utils.safe_popen_read(bin/"rip", "completions", "powershell")
(share/"nu/completions/rip.nu").write Utils.safe_popen_read(bin/"rip", "completions", "nushell")
end

test do
# Create a test file and verify rip can delete it
test_file = testpath/"test.txt"
touch test_file
system bin/"rip", "--graveyard", testpath/"graveyard", test_file.to_s
assert_predicate testpath/"graveyard", :exist?
refute_predicate test_file, :exist?
end
end

0 comments on commit de1c53a

Please sign in to comment.