zoro 20211230 (new formula)

zoro: rename from mr2

Closes #92140.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
Rui Chen 2021-12-28 12:00:38 -05:00 committed by BrewTestBot
parent 59508c3897
commit 933479005c
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
3 changed files with 42 additions and 51 deletions

View File

@ -1,51 +0,0 @@
class Mr2 < Formula
desc "Expose local server to external network"
homepage "https://github.com/txthinking/mr2"
url "https://github.com/txthinking/mr2/archive/refs/tags/v20210401.tar.gz"
sha256 "3cf2874a5945e79fd9ca270181de1a9d6a662434455c58e2e20e5dbfdebd64c7"
license "GPL-3.0-only"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "e1f7f707256fb17fe77bf076823f7da09f929f0dce93f4a93d6cedce12ea117f"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "3b21b5c834d5d3e9472c21b6fd97a1926f5dbab022ea3fb557165a4aaae50f60"
sha256 cellar: :any_skip_relocation, monterey: "b09f149ad6d11c1f589332040539fb8862f56f23b196236b1b9b568c65edba18"
sha256 cellar: :any_skip_relocation, big_sur: "ae3ea4a30eecaedcf6a29f0fb046510a76282d26a3c7d4cabbb9502588769ab5"
sha256 cellar: :any_skip_relocation, catalina: "6ba779bf8b4ea1385176db98611108ad17aad4319da50cd07db102874f7801b0"
sha256 cellar: :any_skip_relocation, mojave: "a1afbf9aeac7c5fb38e63e138ba06eb254a349923887d5fcd530e91f0332dfc9"
sha256 cellar: :any_skip_relocation, x86_64_linux: "22e8ca90f5ff2463a9fe0df44986146468f425b6f6e0dd4148d889fbf35ada6f"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-s -w"), "./cli/mr2"
end
test do
(testpath/"index.html").write <<~EOF
<!DOCTYPE HTML>
<html>
<body>
<p>passed</p>
</body>
</html>
EOF
mr2_server_port = free_port
server_port = free_port
client_port = free_port
server_pid = fork { exec bin/"mr2", "server", "-l", ":#{mr2_server_port}", "-p", "password" }
sleep 5
client_pid = fork do
exec bin/"mr2", "client", "-s", "127.0.0.1:#{mr2_server_port}",
"-p", "password",
"--serverPort", server_port.to_s,
"--clientDirectory", testpath,
"--clientPort", client_port.to_s
end
sleep 3
output = shell_output "curl 127.0.0.1:#{server_port}"
assert_match "passed", output
ensure
Process.kill "SIGTERM", server_pid, client_pid
end
end

41
Formula/zoro.rb Normal file
View File

@ -0,0 +1,41 @@
class Zoro < Formula
desc "Expose local server to external network"
homepage "https://github.com/txthinking/zoro"
url "https://github.com/txthinking/zoro/archive/v20211230.tar.gz"
sha256 "5e78704f4d955cc4fd6dcc3395392e52516f00296cb65454f6959d4b7b54e319"
license "GPL-3.0-only"
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-s -w"), "./cli/zoro"
end
test do
(testpath/"index.html").write <<~EOF
<!DOCTYPE HTML>
<html>
<body>
<p>passed</p>
</body>
</html>
EOF
zoro_server_port = free_port
server_port = free_port
client_port = free_port
server_pid = fork { exec bin/"zoro", "server", "-l", ":#{zoro_server_port}", "-p", "password" }
sleep 5
client_pid = fork do
exec bin/"zoro", "client", "-s", "127.0.0.1:#{zoro_server_port}",
"-p", "password",
"--serverport", server_port.to_s,
"--dir", testpath,
"--dirport", client_port.to_s
end
sleep 3
output = shell_output "curl 127.0.0.1:#{server_port}"
assert_match "passed", output
ensure
Process.kill "SIGTERM", server_pid, client_pid
end
end

View File

@ -96,6 +96,7 @@
"mobile-shell": "mosh",
"mongo-c": "mongo-c-driver",
"mpich2": "mpich",
"mr2": "zoro",
"mysql-connector-c": "mysql-client",
"mysql56": "mysql@5.6",
"newsbeuter": "newsboat",