Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:ezmobius/redis-rb

  • Loading branch information...
commit aa2ff80211f8ffef431f6ee09060fb31e018655e 2 parents 004e7a7 + dac257a
@djanowski djanowski authored
View
2  examples/basic.rb
@@ -3,7 +3,7 @@
r = Redis.new
-r.delete('foo')
+r.del('foo')
puts
View
20 examples/dist_redis.rb
@@ -20,17 +20,17 @@
p r['urmom3']
p r['urdad3']
-r.push_tail 'listor', 'foo1'
-r.push_tail 'listor', 'foo2'
-r.push_tail 'listor', 'foo3'
-r.push_tail 'listor', 'foo4'
-r.push_tail 'listor', 'foo5'
+r.rpush 'listor', 'foo1'
+r.rpush 'listor', 'foo2'
+r.rpush 'listor', 'foo3'
+r.rpush 'listor', 'foo4'
+r.rpush 'listor', 'foo5'
-p r.pop_tail('listor')
-p r.pop_tail('listor')
-p r.pop_tail('listor')
-p r.pop_tail('listor')
-p r.pop_tail('listor')
+p r.rpop('listor')
+p r.rpop('listor')
+p r.rpop('listor')
+p r.rpop('listor')
+p r.rpop('listor')
puts "key distribution:"
View
2  examples/incr-decr.rb
@@ -5,7 +5,7 @@
puts
p 'incr'
-r.delete 'counter'
+r.del 'counter'
p r.incr('counter')
p r.incr('counter')
View
16 examples/list.rb
@@ -3,24 +3,24 @@
r = Redis.new
-r.delete 'logs'
+r.del 'logs'
puts
p "pushing log messages into a LIST"
-r.push_tail 'logs', 'some log message'
-r.push_tail 'logs', 'another log message'
-r.push_tail 'logs', 'yet another log message'
-r.push_tail 'logs', 'also another log message'
+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.list_range('logs', 0, -1)
+p r.lrange('logs', 0, -1)
puts
p 'Trim logs LIST to last 2 elements(easy circular buffer)'
-r.list_trim('logs', -2, -1)
+r.ltrim('logs', -2, -1)
-p r.list_range('logs', 0, -1)
+p r.lrange('logs', 0, -1)
View
22 examples/sets.rb
@@ -3,34 +3,34 @@
r = Redis.new
-r.delete 'foo-tags'
-r.delete 'bar-tags'
+r.del 'foo-tags'
+r.del 'bar-tags'
puts
p "create a set of tags on foo-tags"
-r.set_add 'foo-tags', 'one'
-r.set_add 'foo-tags', 'two'
-r.set_add 'foo-tags', 'three'
+r.sadd 'foo-tags', 'one'
+r.sadd 'foo-tags', 'two'
+r.sadd 'foo-tags', 'three'
puts
p "create a set of tags on bar-tags"
-r.set_add 'bar-tags', 'three'
-r.set_add 'bar-tags', 'four'
-r.set_add 'bar-tags', 'five'
+r.sadd 'bar-tags', 'three'
+r.sadd 'bar-tags', 'four'
+r.sadd 'bar-tags', 'five'
puts
p 'foo-tags'
-p r.set_members('foo-tags')
+p r.smembers('foo-tags')
puts
p 'bar-tags'
-p r.set_members('bar-tags')
+p r.smembers('bar-tags')
puts
p 'intersection of foo-tags and bar-tags'
-p r.set_intersect('foo-tags', 'bar-tags')
+p r.sinter('foo-tags', 'bar-tags')
View
2  lib/redis/dist_redis.rb
@@ -72,7 +72,7 @@ def flush_db
def delete_cloud!
@ring.nodes.each do |red|
red.keys("*").each do |key|
- red.delete key
+ red.del key
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.