Permalink
Browse files

Update commands to match 2.2.

  • Loading branch information...
1 parent 6ce92c5 commit 41b95a996b1edec971f64dc361085a4a476b8d66 @djanowski djanowski committed Dec 27, 2010
Showing with 34 additions and 18 deletions.
  1. +19 −3 Rakefile
  2. +14 −14 lib/nest.rb
  3. +1 −1 nest.gemspec
View
@@ -8,14 +8,30 @@ task :default => :test
task :commands do
require "open-uri"
require "par"
+ require "json"
file = File.expand_path("lib/nest.rb", File.dirname(__FILE__))
- path = "http://dimaion.com/redis/master/keys"
+ path = "https://github.com/antirez/redis-doc/raw/master/commands.json"
- commands = open(path).read.split("\n")
+ commands = JSON.parse(open(path).read).select do |name, command|
+ # Skip all DEBUG commands
+ next if command["group"] == "server"
+
+ # If the command has no arguments, it doesn't operate on a key
+ next if command["arguments"].nil?
+
+ arg = command["arguments"].first
+
+ arg["type"] == "key" ||
+ Array(arg["name"]) == ["channel"]
+ end
+
+ commands = commands.keys.map { |key| key.downcase.to_sym }
+
+ commands.delete(:mget)
source = File.read(file).sub(/ METHODS = .+?\n\n/m) do
- Par.new(" METHODS = #{commands.map(&:to_sym).inspect}\n\n", p: 2)
+ Par.new(" METHODS = #{commands.inspect}\n\n", p: 2)
end
File.open(file, "w") { |f| f.write source }
View
@@ -1,21 +1,21 @@
require "redis"
class Nest < String
- VERSION = "1.0.2"
+ VERSION = "1.1.0"
- METHODS = [:append, :blpop, :brpop, :decr, :decrby, :del, :exists,
- :expire, :expireat, :get, :getset, :hdel, :hexists, :hget, :hgetall,
- :hincrby, :hkeys, :hlen, :hmget, :hmset, :hset, :hsetnx, :hvals,
- :incr, :incrby, :lindex, :linsert, :llen, :lpop, :lpush, :lpushx,
- :lrange, :lrem, :lset, :ltrim, :move, :psubscribe, :publish,
- :punsubscribe, :rename, :renamenx, :rpop, :rpoplpush, :rpush,
- :rpushx, :sadd, :scard, :sdiff, :sdiffstore, :set, :setex, :setnx,
- :sinter, :sinterstore, :sismember, :smembers, :smove, :sort,
- :spop, :srandmember, :srem, :strlen, :subscribe, :substr, :sunion,
- :sunionstore, :ttl, :type, :unsubscribe, :watch, :zadd, :zcard,
- :zcount, :zincrby, :zinterstore, :zrange, :zrangebyscore, :zrank,
- :zrem, :zremrangebyrank, :zremrangebyscore, :zrevrange, :zrevrank,
- :zscore, :zunionstore]
+ METHODS = [:append, :blpop, :brpop, :brpoplpush, :decr, :decrby,
+ :del, :exists, :expire, :expireat, :get, :getbit, :getrange, :getset,
+ :hdel, :hexists, :hget, :hgetall, :hincrby, :hkeys, :hlen, :hmget,
+ :hmset, :hset, :hsetnx, :hvals, :incr, :incrby, :lindex, :linsert,
+ :llen, :lpop, :lpush, :lpushx, :lrange, :lrem, :lset, :ltrim, :move,
+ :persist, :publish, :rename, :renamenx, :rpop, :rpoplpush, :rpush,
+ :rpushx, :sadd, :scard, :sdiff, :sdiffstore, :set, :setbit, :setex,
+ :setnx, :setrange, :sinter, :sinterstore, :sismember, :smembers,
+ :smove, :sort, :spop, :srandmember, :srem, :strlen, :subscribe,
+ :sunion, :sunionstore, :ttl, :type, :unsubscribe, :watch, :zadd,
+ :zcard, :zcount, :zincrby, :zinterstore, :zrange, :zrangebyscore,
+ :zrank, :zrem, :zremrangebyrank, :zremrangebyscore, :zrevrange,
+ :zrevrangebyscore, :zrevrank, :zscore, :zunionstore]
attr :redis
View
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "nest"
- s.version = "1.0.2"
+ s.version = "1.1.0"
s.summary = "Object-oriented keys for Redis."
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."
s.authors = ["Michel Martens"]

0 comments on commit 41b95a9

Please sign in to comment.