nest 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/nest.rb +14 -13
  2. data/nest.gemspec +1 -1
  3. metadata +4 -4
data/lib/nest.rb CHANGED
@@ -1,8 +1,19 @@
1
1
  class Nest < String
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
+ METHODS = [:append, :blpop, :brpop, :decr, :decrby, :del, :exists,
4
+ :expire, :expireat, :get, :getset, :hdel, :hexists, :hget, :hgetall,
5
+ :hincrby, :hkeys, :hlen, :hmset, :hset, :hvals, :incr, :incrby,
6
+ :lindex, :llen, :lpop, :lpush, :lrange, :lrem, :lset, :ltrim, :move,
7
+ :rename, :renamenx, :rpop, :rpoplpush, :rpush, :sadd, :scard, :sdiff,
8
+ :sdiffstore, :set, :setex, :setnx, :sinter, :sinterstore, :sismember,
9
+ :smembers, :smove, :sort, :spop, :srandmember, :srem, :substr,
10
+ :sunion, :sunionstore, :ttl, :type, :unwatch, :watch, :zadd, :zcard,
11
+ :zincrby, :zinterstore, :zrange, :zrangebyscore, :zrank, :zrem,
12
+ :zremrangebyrank, :zremrangebyscore, :zrevrange, :zrevrank, :zscore,
13
+ :zunionstore]
3
14
 
4
15
  def initialize(key, redis = nil)
5
- super(key)
16
+ super(key.to_s)
6
17
  @redis = redis
7
18
  end
8
19
 
@@ -10,17 +21,7 @@ class Nest < String
10
21
  self.class.new("#{self}:#{key}", redis)
11
22
  end
12
23
 
13
- [:append, :blpop, :brpop, :decr, :decrby, :del, :exists, :expire,
14
- :expireat, :get, :getset, :hdel, :hexists, :hget, :hgetall,
15
- :hincrby, :hkeys, :hlen, :hmset, :hset, :hvals, :incr, :incrby,
16
- :lindex, :llen, :lpop, :lpush, :lrange, :lrem, :lset, :ltrim, :move,
17
- :rename, :renamenx, :rpop, :rpoplpush, :rpush, :sadd, :scard,
18
- :sdiff, :sdiffstore, :set, :setex, :setnx, :sinter, :sinterstore,
19
- :sismember, :smembers, :smove, :sort, :spop, :srandmember, :srem,
20
- :substr, :sunion, :sunionstore, :ttl, :type, :zadd, :zcard,
21
- :zincrby, :zinterstore, :zrange, :zrangebyscore, :zrank, :zrem,
22
- :zremrangebyrank, :zremrangebyscore, :zrevrange, :zrevrank, :zscore,
23
- :zunionstore].each do |meth|
24
+ METHODS.each do |meth|
24
25
  define_method(meth) do |*args|
25
26
  redis.send(meth, self, *args)
26
27
  end
data/nest.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "nest"
3
- s.version = "0.0.4"
3
+ s.version = "0.0.5"
4
4
  s.summary = "Generate nested namespaced keys for key-value databases."
5
5
  s.description = "It is a design pattern in key-value databases to use the key to simulate structure, and Nest can take care of that."
6
6
  s.authors = ["Michel Martens"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michel Martens
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-18 00:00:00 -03:00
18
+ date: 2010-05-29 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies: []
21
21