Runnable examples for Valkey GLIDE Ruby. Requires a Valkey or Redis OSS server unless noted.
From the repository root:
bin/setupRun examples with the gem loaded from lib/:
bundle exec ruby examples/standalone.rbOr:
RUBYOPT="-I$(pwd)/lib" ruby examples/standalone.rb| File | Description | Server |
|---|---|---|
| standalone.rb | Basic connect, SET, GET | Standalone :6379 |
| cluster.rb | Cluster connect, SET, GET | Cluster :7000–:7005 |
| pipelining.rb | Non-atomic pipeline | Standalone :6379 |
| opentelemetry.rb | OTel file exporter + traced commands | Standalone :6379 |
| statistics.rb | Client statistics | Standalone :6379 |
| Variable | Default | Purpose |
|---|---|---|
VALKEY_HOST |
127.0.0.1 |
Server host |
VALKEY_PORT |
6379 |
Standalone port |
VALKEY_CLUSTER_PORT |
7000 |
First cluster node port |
docker run -d --name valkey -p 6379:6379 valkey/valkey:8
bundle exec ruby examples/standalone.rbdocker run -d -p 7000-7005:7000-7005 grokzen/redis-cluster:7.0.15
bundle exec ruby examples/cluster.rb