redis 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +23 -1
- data/lib/redis.rb +1 -1
- data/lib/redis/client.rb +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
@@ -31,7 +31,29 @@ spec = Gem::Specification.new do |s|
|
|
31
31
|
s.files = %w(LICENSE README.markdown Rakefile) + Dir.glob("{lib,tasks,spec}/**/*")
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
REDIS_DIR = File.expand_path(File.join("..", "test"), __FILE__)
|
35
|
+
REDIS_CNF = File.join(REDIS_DIR, "test.conf")
|
36
|
+
REDIS_PID = File.join(REDIS_DIR, "db", "redis.pid")
|
37
|
+
|
38
|
+
task :default => :run
|
39
|
+
|
40
|
+
desc "Run tests and manage server start/stop"
|
41
|
+
task :run => [:start, :test, :stop]
|
42
|
+
|
43
|
+
desc "Start the Redis server"
|
44
|
+
task :start do
|
45
|
+
unless File.exists?(REDIS_PID)
|
46
|
+
system "redis-server #{REDIS_CNF}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
desc "Stop the Redis server"
|
51
|
+
task :stop do
|
52
|
+
if File.exists?(REDIS_PID)
|
53
|
+
system "kill #{File.read(REDIS_PID)}"
|
54
|
+
system "rm #{REDIS_PID}"
|
55
|
+
end
|
56
|
+
end
|
35
57
|
|
36
58
|
Rake::TestTask.new(:test) do |t|
|
37
59
|
t.pattern = 'test/**/*_test.rb'
|
data/lib/redis.rb
CHANGED
data/lib/redis/client.rb
CHANGED
@@ -291,7 +291,7 @@ class Redis
|
|
291
291
|
type, *reply = read_reply # type, [class,data]
|
292
292
|
case type
|
293
293
|
when 'subscribe','unsubscribe'
|
294
|
-
sub.send(type) && sub.send(type).call(reply[0])
|
294
|
+
sub.send(type) && sub.send(type).call(reply[0],reply[1])
|
295
295
|
when 'message'
|
296
296
|
sub.send(type) && sub.send(type).call(reply[0],reply[1])
|
297
297
|
end
|