redis class for mruby.
C Ruby Makefile
Latest commit fd99d1a Jun 3, 2016 @matsumoto-r Merge pull request #54 from sawanoboly/avoid_loop_initial_declarations
declare before for_loop to compatibility
Failed to load latest commit information.
example
include/mruby
mrblib
src
test
.clang-format
.gitignore
.travis.yml
README.md
Rakefile
build_config.rb
mrbgem.rake Fix failed compile under OS X May 25, 2016

README.md

mruby-redis Build Status

Hiredis binding for mruby. Hiredis is a minimalistic C client library for the Redis database. Redis is an open source, BSD-licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. Plese visit redis' official website for more details about Redis.

Running Redis might be impossible for memory/CPU-constrained environments, so we can recommend mruby-vedis. vedis is an embeddable datastore distributed as a C library. It supports over 70 commands similar to Redis, but runs in memory (hence doesn't require a networking layer). Please visit vedis' website for more details.

INSTALLATION

Using mrbgems

Add conf.gem line to build_config.rb:

MRuby::Build.new do |conf|

    # ... (snip) ...

    conf.gem :git => 'https://github.com/matsumoto-r/mruby-redis.git'
end

USAGE

Connecting to a Redis server

client = Redis.new "127.0.0.1", 6379, 2 # Connect to the server
client.select 0                         # Select the database

Commands

Redis#[]=

TBD

Redis#[]

client["key"]

Redis#bulk_reply

TBD

Redis#close

TBD

Redis#decr doc

client.decr "key"

Redis#decrby doc

TBD

Redis#del doc

client.del "key"

Redis#exists? doc

client.exists?("key")

Redis#expire doc

TBD

Redis#flushdb doc

TBD

Redis#get doc

client.get "key"

Redis#hdel doc

client.hdel "myhash", "field1"

Redis#hget doc

client.hget "myhash", "field1"

Redis#hgetall doc

TBD

Redis#hkeys doc

TBD

Redis#hset doc

client.hset "myhash", "field1", "a"

Redis#incr doc

client.incr "key"

Redis#incrby doc

TBD

Redis#keys doc

TBD

Redis#lindex doc

TBD

Redis#llen doc

TBD

Redis#lpop doc

TBD

Redis#lpush doc

TBD

Redis#lrange doc

client.lrange "logs", 0, -1

Redis#ltrim doc

client.ltrim "logs", 1, -1

Redis#publish doc

TBD

Redis#queue doc

TBD

Redis#randomkey doc

TBD

Redis#reply doc

TBD

Redis#rpop doc

TBD

Redis#rpush doc

TBD

Redis#sadd doc

TBD

Redis#scard doc

TBD

Redis#set doc

client.set key, "200"

Redis#sismember doc

TBD

Redis#smembers doc

TBD

Redis#spop doc

TBD

Redis#ttl doc

TBD

Redis#zadd doc

client.zadd "hs", 80, "a"

Redis#zcard doc

TBD

Redis#zrange doc

client.zrange "hs", 0, -1

Redis#zrank doc

client.zrank "hs", "a"

Redis#zrevrange doc

client.zrevrange "hs", 0, -1

Redis#zrevrank doc

client.zrevrank "hs", "a"

Redis#zscore doc

client.zscore "hs", "a"

See example/redis.rb for more details.

LICENSE

MIT License - Copyright (c) mod_mruby developers 2012