Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redka 0.5.3 (new formula) #198821

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/autobump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2476,6 +2476,7 @@ recc
recode
recoverpy
redict
redka
redress
redwax-tool
regclient
Expand Down
46 changes: 46 additions & 0 deletions Formula/r/redka.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
class Redka < Formula
desc "Redis re-implemented with SQLite"
homepage "https://github.com/nalgeon/redka"
url "https://github.com/nalgeon/redka/archive/refs/tags/v0.5.3.tar.gz"
sha256 "c5b1746f5c1af905d79247b1e3d808c0da14fd8caf1115023a4d12fe3ad8ebe4"
license "BSD-3-Clause"
head "https://github.com/nalgeon/redka.git", branch: "main"

bottle do
sha256 cellar: :any_skip_relocation, arm64_sequoia: "d76c91050ffe415ee014050dac28fedb3983a99ddda83e6a04c4009b7a100313"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "2afe1b51f17c267bd70f8ced5c96f3d4f3895852883fa19eaba5145c9df7bc62"
sha256 cellar: :any_skip_relocation, arm64_ventura: "8be640a9fe22bb2c23b00fbd7932235ed62dc3aad5fe1dabb1bcc9c9f0ae4e17"
sha256 cellar: :any_skip_relocation, sonoma: "41ce5588bf143a988a41ef0ee17c6e4d581a8e326372c74accd54bcebe1529b1"
sha256 cellar: :any_skip_relocation, ventura: "bb78c4e52d6177cebaf0f1d1afabaf3da46c85841b6feb0e312a605123035d82"
sha256 cellar: :any_skip_relocation, x86_64_linux: "a518059a8ea13f550bc38204414142a839adba3458eb31808b17e1a438a59d0e"
end

depends_on "go" => :build
# use valkey for server startup test as redka-cli can just inspect db dump
depends_on "valkey" => :test
uses_from_macos "sqlite"

def install
ldflags = "-s -w -X main.version=v#{version}"
system "go", "build", *std_go_args(ldflags:, output: bin/"redka"), "./cmd/redka"
system "go", "build", *std_go_args(ldflags:, output: bin/"redka-cli"), "./cmd/cli"
end

test do
port = free_port
test_db = testpath/"test.db"

pid = fork do
exec bin/"redka", "-h", "127.0.0.1", "-p", port.to_s, test_db
end
sleep 2

begin
output = shell_output("redis-cli -h 127.0.0.1 -p #{port} ping")
assert_equal "PONG", output.strip
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
Loading