em-redis 0.2.2 → 0.2.3

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.
@@ -90,13 +90,20 @@ EM.describe EM::Protocols::Redis do
90
90
  done
91
91
  end
92
92
 
93
- should "trigger a given error callback for inline error response instead of raising an error" do
93
+ should "trigger a given error callback (specified with on_error) for inline error response instead of raising an error" do
94
94
  lambda do
95
95
  @c.call_command(["blarg"])
96
96
  @c.on_error {|code| code.should == "FAIL"; done }
97
97
  @c.receive_data "-FAIL\r\n"
98
98
  end.should.not.raise(EM::P::Redis::RedisError)
99
- done
99
+ end
100
+
101
+ should "trigger a given error callback for inline error response instead of raising an error" do
102
+ lambda do
103
+ @c.call_command(["blarg"])
104
+ @c.errback { |code| code.should == "FAIL"; done }
105
+ @c.receive_data "-FAIL\r\n"
106
+ end.should.not.raise(EM::P::Redis::RedisError)
100
107
  end
101
108
 
102
109
  # Bulk response
@@ -112,6 +119,7 @@ EM.describe EM::Protocols::Redis do
112
119
  should "distinguish nil in a bulk response" do
113
120
  @c.call_command(["GET", "bar"]) do |resp|
114
121
  resp.should == nil
122
+ done
115
123
  end
116
124
  @c.receive_data "$-1\r\n"
117
125
  end
@@ -5,14 +5,21 @@ EM.spec_backend = EventMachine::Spec::Bacon
5
5
 
6
6
  class TestConnection
7
7
  include EM::P::Redis
8
+
8
9
  def send_data data
9
10
  sent_data << data
10
11
  end
12
+
11
13
  def sent_data
12
14
  @sent_data ||= ''
13
15
  end
14
16
 
17
+ def maybe_lock
18
+ yield
19
+ end
20
+
15
21
  def initialize
22
+ super
16
23
  connection_completed
17
24
  end
18
25
  end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 3
9
+ version: 0.2.3
5
10
  platform: ruby
6
11
  authors:
7
12
  - Jonathan Broad
@@ -10,57 +15,66 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2009-12-29 00:00:00 +03:00
18
+ date: 2010-08-11 00:00:00 +04:00
14
19
  default_executable:
15
20
  dependencies:
16
21
  - !ruby/object:Gem::Dependency
17
22
  name: eventmachine
18
- type: :runtime
19
- version_requirement:
20
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
21
25
  requirements:
22
26
  - - ">="
23
27
  - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 12
31
+ - 10
24
32
  version: 0.12.10
25
- version:
33
+ type: :runtime
34
+ version_requirements: *id001
26
35
  - !ruby/object:Gem::Dependency
27
36
  name: bacon
28
- type: :development
29
- version_requirement:
30
- version_requirements: !ruby/object:Gem::Requirement
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
31
39
  requirements:
32
40
  - - ">="
33
41
  - !ruby/object:Gem::Version
42
+ segments:
43
+ - 1
44
+ - 1
45
+ - 0
34
46
  version: 1.1.0
35
- version:
47
+ type: :development
48
+ version_requirements: *id002
36
49
  - !ruby/object:Gem::Dependency
37
50
  name: em-spec
38
- type: :development
39
- version_requirement:
40
- version_requirements: !ruby/object:Gem::Requirement
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
41
53
  requirements:
42
54
  - - ">="
43
55
  - !ruby/object:Gem::Version
44
- version: 0.2.0
45
- version:
56
+ segments:
57
+ - 0
58
+ - 2
59
+ - 1
60
+ version: 0.2.1
61
+ type: :development
62
+ version_requirements: *id003
46
63
  - !ruby/object:Gem::Dependency
47
64
  name: bones
48
- type: :development
49
- version_requirement:
50
- version_requirements: !ruby/object:Gem::Requirement
65
+ prerelease: false
66
+ requirement: &id004 !ruby/object:Gem::Requirement
51
67
  requirements:
52
68
  - - ">="
53
69
  - !ruby/object:Gem::Version
54
- version: 3.2.0
55
- version:
56
- description: |-
57
- An EventMachine[http://rubyeventmachine.com/] based library for interacting with the very cool Redis[http://code.google.com/p/redis/] data store by Salvatore 'antirez' Sanfilippo.
58
- Modeled after eventmachine's implementation of the memcached protocol, and influenced by Ezra Zygmuntowicz's {redis-rb}[http://github.com/ezmobius/redis-rb/tree/master] library (distributed as part of Redis).
59
-
60
- This library is only useful when used as part of an application that relies on
61
- Event Machine's event loop. It implements an EM-based client protocol, which
62
- leverages the non-blocking nature of the EM interface to achieve significant
63
- parallelization without threads.
70
+ segments:
71
+ - 3
72
+ - 2
73
+ - 1
74
+ version: 3.2.1
75
+ type: :development
76
+ version_requirements: *id004
77
+ description: An eventmachine-based implementation of the Redis protocol
64
78
  email: libc@me.com
65
79
  executables: []
66
80
 
@@ -68,22 +82,20 @@ extensions: []
68
82
 
69
83
  extra_rdoc_files:
70
84
  - History.txt
71
- - Manifest.txt
72
85
  - README.rdoc
73
86
  files:
74
87
  - .gitignore
75
88
  - History.txt
76
- - Manifest.txt
77
89
  - README.rdoc
78
90
  - Rakefile
79
91
  - lib/em-redis.rb
80
92
  - lib/em-redis/redis_protocol.rb
81
93
  - spec/live_redis_protocol_spec.rb
94
+ - spec/redis_commands_spec.rb
82
95
  - spec/redis_protocol_spec.rb
83
96
  - spec/test_helper.rb
84
- - tasks/em-redis.rake
85
97
  has_rdoc: true
86
- homepage:
98
+ homepage: http://github.com/libc/em-redis
87
99
  licenses: []
88
100
 
89
101
  post_install_message:
@@ -96,20 +108,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
108
  requirements:
97
109
  - - ">="
98
110
  - !ruby/object:Gem::Version
111
+ segments:
112
+ - 0
99
113
  version: "0"
100
- version:
101
114
  required_rubygems_version: !ruby/object:Gem::Requirement
102
115
  requirements:
103
116
  - - ">="
104
117
  - !ruby/object:Gem::Version
118
+ segments:
119
+ - 0
105
120
  version: "0"
106
- version:
107
121
  requirements: []
108
122
 
109
123
  rubyforge_project: em-redis
110
- rubygems_version: 1.3.5
124
+ rubygems_version: 1.3.6
111
125
  signing_key:
112
126
  specification_version: 3
113
- summary: An EventMachine[http://rubyeventmachine
127
+ summary: An eventmachine-based implementation of the Redis protocol
114
128
  test_files: []
115
129
 
@@ -1,10 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.rdoc
4
- em-redis.gemspec
5
- Rakefile
6
- lib/em-redis.rb
7
- lib/em-redis/redis_protocol.rb
8
- spec/test_helper.rb
9
- spec/live_redis_protocol_spec.rb
10
- spec/redis_protocol_spec.rb
@@ -1,12 +0,0 @@
1
- namespace :redis do
2
- desc "Test em-redis against a live Redis"
3
- task :live_test do
4
- require 'bacon'
5
- sh "bacon spec/live_redis_protocol_spec.rb"
6
- end
7
-
8
- desc "Test em-redis offline"
9
- task :offline_test do
10
- sh "bacon spec/redis_protocol_spec.rb"
11
- end
12
- end