redis 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +23 -1
  2. data/lib/redis.rb +1 -1
  3. data/lib/redis/client.rb +1 -1
  4. 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
- task :default => :test
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'
@@ -1,7 +1,7 @@
1
1
  require 'socket'
2
2
 
3
3
  class Redis
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
 
6
6
  def self.new(*attrs)
7
7
  Client.new(*attrs)
@@ -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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 1
9
- version: 1.0.1
8
+ - 2
9
+ version: 1.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ezra Zygmuntowicz