Sha256: b3894411e369b4ff83a602979290730a2d6a7e46d6bd4564f9b8d7afc8c8f6eb
Contents?: true
Size: 443 Bytes
Versions: 103
Compression:
Stored size: 443 Bytes
Contents
require 'rubygems' require 'redis' r = Redis.new r.del 'logs' puts p "pushing log messages into a LIST" r.rpush 'logs', 'some log message' r.rpush 'logs', 'another log message' r.rpush 'logs', 'yet another log message' r.rpush 'logs', 'also another log message' puts p 'contents of logs LIST' p r.lrange('logs', 0, -1) puts p 'Trim logs LIST to last 2 elements(easy circular buffer)' r.ltrim('logs', -2, -1) p r.lrange('logs', 0, -1)
Version data entries
103 entries across 101 versions & 16 rubygems