nest 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +19 -3
- data/lib/nest.rb +14 -14
- data/nest.gemspec +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
@@ -8,14 +8,30 @@ task :default => :test
|
|
8
8
|
task :commands do
|
9
9
|
require "open-uri"
|
10
10
|
require "par"
|
11
|
+
require "json"
|
11
12
|
|
12
13
|
file = File.expand_path("lib/nest.rb", File.dirname(__FILE__))
|
13
|
-
path = "
|
14
|
+
path = "https://github.com/antirez/redis-doc/raw/master/commands.json"
|
14
15
|
|
15
|
-
commands = open(path).read.
|
16
|
+
commands = JSON.parse(open(path).read).select do |name, command|
|
17
|
+
# Skip all DEBUG commands
|
18
|
+
next if command["group"] == "server"
|
19
|
+
|
20
|
+
# If the command has no arguments, it doesn't operate on a key
|
21
|
+
next if command["arguments"].nil?
|
22
|
+
|
23
|
+
arg = command["arguments"].first
|
24
|
+
|
25
|
+
arg["type"] == "key" ||
|
26
|
+
Array(arg["name"]) == ["channel"]
|
27
|
+
end
|
28
|
+
|
29
|
+
commands = commands.keys.map { |key| key.downcase.to_sym }
|
30
|
+
|
31
|
+
commands.delete(:mget)
|
16
32
|
|
17
33
|
source = File.read(file).sub(/ METHODS = .+?\n\n/m) do
|
18
|
-
Par.new(" METHODS = #{commands.
|
34
|
+
Par.new(" METHODS = #{commands.inspect}\n\n", p: 2)
|
19
35
|
end
|
20
36
|
|
21
37
|
File.open(file, "w") { |f| f.write source }
|
data/lib/nest.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
require "redis"
|
2
2
|
|
3
3
|
class Nest < String
|
4
|
-
VERSION = "1.0
|
4
|
+
VERSION = "1.1.0"
|
5
5
|
|
6
|
-
METHODS = [:append, :blpop, :brpop, :
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:rpushx, :sadd, :scard, :sdiff, :sdiffstore, :set, :
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:sunionstore, :ttl, :type, :unsubscribe, :watch, :zadd,
|
16
|
-
:zcount, :zincrby, :zinterstore, :zrange, :zrangebyscore,
|
17
|
-
:zrem, :zremrangebyrank, :zremrangebyscore, :zrevrange,
|
18
|
-
:zscore, :zunionstore]
|
6
|
+
METHODS = [:append, :blpop, :brpop, :brpoplpush, :decr, :decrby,
|
7
|
+
:del, :exists, :expire, :expireat, :get, :getbit, :getrange, :getset,
|
8
|
+
:hdel, :hexists, :hget, :hgetall, :hincrby, :hkeys, :hlen, :hmget,
|
9
|
+
:hmset, :hset, :hsetnx, :hvals, :incr, :incrby, :lindex, :linsert,
|
10
|
+
:llen, :lpop, :lpush, :lpushx, :lrange, :lrem, :lset, :ltrim, :move,
|
11
|
+
:persist, :publish, :rename, :renamenx, :rpop, :rpoplpush, :rpush,
|
12
|
+
:rpushx, :sadd, :scard, :sdiff, :sdiffstore, :set, :setbit, :setex,
|
13
|
+
:setnx, :setrange, :sinter, :sinterstore, :sismember, :smembers,
|
14
|
+
:smove, :sort, :spop, :srandmember, :srem, :strlen, :subscribe,
|
15
|
+
:sunion, :sunionstore, :ttl, :type, :unsubscribe, :watch, :zadd,
|
16
|
+
:zcard, :zcount, :zincrby, :zinterstore, :zrange, :zrangebyscore,
|
17
|
+
:zrank, :zrem, :zremrangebyrank, :zremrangebyscore, :zrevrange,
|
18
|
+
:zrevrangebyscore, :zrevrank, :zscore, :zunionstore]
|
19
19
|
|
20
20
|
attr :redis
|
21
21
|
|
data/nest.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "nest"
|
3
|
-
s.version = "1.0
|
3
|
+
s.version = "1.1.0"
|
4
4
|
s.summary = "Object-oriented keys for Redis."
|
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"]
|