30 lines
717 B
Ruby
30 lines
717 B
Ruby
|
class Ox < Formula
|
||
|
desc "Independent Rust text editor that runs in your terminal"
|
||
|
homepage "https://github.com/curlpipe/ox"
|
||
|
url "https://github.com/curlpipe/ox/archive/0.2.5.tar.gz"
|
||
|
sha256 "873eb447029508bc3fd1d7dda8803d79a7b107a7a903399947f4eac6ae671176"
|
||
|
license "GPL-2.0-only"
|
||
|
head "https://github.com/curlpipe/ox.git"
|
||
|
|
||
|
depends_on "rust" => :build
|
||
|
|
||
|
def install
|
||
|
system "cargo", "install", *std_cargo_args
|
||
|
end
|
||
|
|
||
|
test do
|
||
|
require "pty"
|
||
|
|
||
|
_, w, pid = PTY.spawn(bin/"ox", "test.txt")
|
||
|
sleep 1
|
||
|
w.write "Hello Homebrew!\n"
|
||
|
w.write "\cS"
|
||
|
sleep 1
|
||
|
w.write "\cQ"
|
||
|
|
||
|
assert_match "Hello Homebrew!\n", (testpath/"test.txt").read
|
||
|
ensure
|
||
|
Process.kill("TERM", pid)
|
||
|
end
|
||
|
end
|