Skip to content

Instantly share code, notes, and snippets.

@matsumotory
Created December 3, 2012 10:20
Show Gist options
  • Save matsumotory/4194067 to your computer and use it in GitHub Desktop.
Save matsumotory/4194067 to your computer and use it in GitHub Desktop.
redis by mod_mruby
r = Apache::Request.new()
r.content_type = "text/html"
a = Apache
host = "127.0.0.1"
port = 6379
a.rputs("> redis connect " + host + ":" + port.to_s + "<br>")
redis = Apache::Redis.new(host, port)
key="hoge"
val="aaaaaaaaaaaaaa"
a.rputs("> redis set " + key + " " + val + "<br>")
redis.set(key, val)
a.rputs("> redis get " + key + "<br>")
Apache.rputs(key + ": " + redis.get(key))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment