couchbase 1.2.1-x86-mingw32 → 1.2.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/tasks/compile.rake CHANGED
@@ -84,7 +84,7 @@ namespace :ports do
84
84
  directory "ports"
85
85
 
86
86
  task :libcouchbase => ["ports"] do
87
- recipe = MiniPortile.new "libcouchbase", "2.0.1"
87
+ recipe = MiniPortile.new "libcouchbase", "2.0.3"
88
88
  recipe.files << "http://packages.couchbase.com/clients/c/libcouchbase-#{recipe.version}.tar.gz"
89
89
  recipe.configure_options.push("--disable-debug",
90
90
  "--disable-dependency-tracking",
data/test/test_async.rb CHANGED
@@ -250,4 +250,67 @@ class TestAsync < MiniTest::Unit::TestCase
250
250
  end
251
251
  end
252
252
 
253
+ def test_asynchronous_connection
254
+ connection = Couchbase.new(:hostname => @mock.host, :port => @mock.port, :async => true)
255
+ refute connection.connected?, "new asynchronous connection must be disconnected"
256
+ connection.on_connect do |res|
257
+ assert res.success?, "on_connect called with error #{res.error.inspect}"
258
+ assert_same connection, res.bucket
259
+ end
260
+ connection.run {}
261
+ assert connection.connected?, "it should be connected after first run"
262
+ end
263
+
264
+ def test_it_calls_callback_immediately_if_connected_sync
265
+ connection = Couchbase.new(:hostname => @mock.host, :port => @mock.port)
266
+ assert connection.connected?, "connection wasn't established in sync mode"
267
+ called = false
268
+ connection.on_connect do |res|
269
+ assert res.success?, "on_connect called with error #{res.error.inspect}"
270
+ called = true
271
+ end
272
+ assert called, "the callback hasn't been called on set"
273
+ called = false
274
+ connection.on_connect do |res|
275
+ assert res.success?, "on_connect called with error #{res.error.inspect}"
276
+ called = true
277
+ end
278
+ refute called, "the callback must not be called on subsequent sets"
279
+ end
280
+
281
+ def test_it_calls_callback_immediately_if_connected_async
282
+ connection = Couchbase.new(:hostname => @mock.host, :port => @mock.port, :async => true)
283
+ refute connection.connected?, "new asynchronous connection must be disconnected"
284
+ called = false
285
+ connection.run {}
286
+ assert connection.connected?, "the connection must be established"
287
+ connection.run do
288
+ connection.on_connect do |res|
289
+ assert res.success?, "on_connect called with error #{res.error.inspect}"
290
+ called = true
291
+ end
292
+ end
293
+ assert called, "the callback hasn't been called on set"
294
+ called = false
295
+ connection.run do
296
+ connection.on_connect do |res|
297
+ assert res.success?, "on_connect called with error #{res.error.inspect}"
298
+ called = true
299
+ end
300
+ end
301
+ refute called, "the callback must not be called on subsequent sets"
302
+ end
303
+
304
+ def test_it_returns_error_if_user_start_work_on_disconnected_instance_outside_on_connect_callback
305
+ connection = Couchbase.new(:hostname => @mock.host, :port => @mock.port, :async => true)
306
+ refute connection.connected?, "new asynchronous connection must be disconnected"
307
+ error = nil
308
+ connection.on_error do |ex|
309
+ error = ex
310
+ end
311
+ connection.run do |c|
312
+ c.set("foo", "bar")
313
+ end
314
+ assert_instance_of(Couchbase::Error::Connect, error)
315
+ end
253
316
  end
@@ -0,0 +1,70 @@
1
+ # Author:: Couchbase <info@couchbase.com>
2
+ # Copyright:: 2011, 2012 Couchbase, Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ require File.join(File.dirname(__FILE__), 'setup')
19
+ require 'eventmachine'
20
+
21
+ class TestEventmachine < MiniTest::Unit::TestCase
22
+
23
+ def setup
24
+ @mock = start_mock
25
+ end
26
+
27
+ def teardown
28
+ stop_mock(@mock)
29
+ end
30
+
31
+ if RUBY_VERSION.to_f >= 1.9
32
+
33
+ def test_trivial_set
34
+ EM.run do
35
+ conn = Couchbase.new(:hostname => @mock.host, :port => @mock.port,
36
+ :engine => :eventmachine, :async => true)
37
+ conn.on_connect do |res|
38
+ assert res.success?, "connection must be successful"
39
+ conn.set(uniq_id, "bar") do |res|
40
+ assert res.success?, "the operation must be successful"
41
+ assert res.cas > 0, "the CAS value must be non-zero"
42
+ EM.stop
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ def test_trivial_get
49
+ EM.run do
50
+ conn = Couchbase.new(:hostname => @mock.host, :port => @mock.port,
51
+ :engine => :eventmachine, :async => true)
52
+ conn.on_connect do |res|
53
+ assert res.success?, "connection must be successful"
54
+ conn.set(uniq_id, "bar") do |res|
55
+ assert res.success?, "the set operation must be successful"
56
+ cas = res.cas
57
+ conn.get(uniq_id) do |res|
58
+ assert res.success?, "the get operation must be successful"
59
+ assert_equal "bar", res.value
60
+ assert_equal cas, res.cas
61
+ EM.stop
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+
68
+ end
69
+
70
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  prerelease:
6
6
  platform: x86-mingw32
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-28 00:00:00.000000000 Z
12
+ date: 2013-02-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yaji
@@ -48,17 +48,17 @@ dependencies:
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ~>
51
+ - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
- version: 0.8.7
53
+ version: '0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ~>
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.7
61
+ version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: minitest
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -92,23 +92,7 @@ dependencies:
92
92
  - !ruby/object:Gem::Version
93
93
  version: 0.7.5
94
94
  - !ruby/object:Gem::Dependency
95
- name: rdiscount
96
- requirement: !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ! '>='
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- - !ruby/object:Gem::Dependency
111
- name: yard
95
+ name: mini_portile
112
96
  requirement: !ruby/object:Gem::Requirement
113
97
  none: false
114
98
  requirements:
@@ -124,23 +108,23 @@ dependencies:
124
108
  - !ruby/object:Gem::Version
125
109
  version: '0'
126
110
  - !ruby/object:Gem::Dependency
127
- name: yard-xml
111
+ name: yajl-ruby
128
112
  requirement: !ruby/object:Gem::Requirement
129
113
  none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - ~>
132
116
  - !ruby/object:Gem::Version
133
- version: '0'
117
+ version: 1.1.0
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
121
  none: false
138
122
  requirements:
139
- - - ! '>='
123
+ - - ~>
140
124
  - !ruby/object:Gem::Version
141
- version: '0'
125
+ version: 1.1.0
142
126
  - !ruby/object:Gem::Dependency
143
- name: mini_portile
127
+ name: active_support
144
128
  requirement: !ruby/object:Gem::Requirement
145
129
  none: false
146
130
  requirements:
@@ -156,23 +140,7 @@ dependencies:
156
140
  - !ruby/object:Gem::Version
157
141
  version: '0'
158
142
  - !ruby/object:Gem::Dependency
159
- name: yajl-ruby
160
- requirement: !ruby/object:Gem::Requirement
161
- none: false
162
- requirements:
163
- - - ~>
164
- - !ruby/object:Gem::Version
165
- version: 1.1.0
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
- requirements:
171
- - - ~>
172
- - !ruby/object:Gem::Version
173
- version: 1.1.0
174
- - !ruby/object:Gem::Dependency
175
- name: active_support
143
+ name: eventmachine
176
144
  requirement: !ruby/object:Gem::Requirement
177
145
  none: false
178
146
  requirements:
@@ -203,19 +171,25 @@ files:
203
171
  - RELEASE_NOTES.markdown
204
172
  - Rakefile
205
173
  - couchbase.gemspec
174
+ - examples/chat-em/Gemfile
175
+ - examples/chat-em/README.markdown
176
+ - examples/chat-em/server.rb
206
177
  - ext/couchbase_ext/.gitignore
207
178
  - ext/couchbase_ext/arguments.c
208
179
  - ext/couchbase_ext/arithmetic.c
209
180
  - ext/couchbase_ext/bucket.c
181
+ - ext/couchbase_ext/context.c
210
182
  - ext/couchbase_ext/couchbase_ext.c
211
183
  - ext/couchbase_ext/couchbase_ext.h
212
184
  - ext/couchbase_ext/delete.c
185
+ - ext/couchbase_ext/eventmachine_plugin.c
213
186
  - ext/couchbase_ext/extconf.rb
214
187
  - ext/couchbase_ext/get.c
215
188
  - ext/couchbase_ext/gethrtime.c
216
189
  - ext/couchbase_ext/http.c
217
190
  - ext/couchbase_ext/multithread_plugin.c
218
191
  - ext/couchbase_ext/observe.c
192
+ - ext/couchbase_ext/plugin_common.c
219
193
  - ext/couchbase_ext/result.c
220
194
  - ext/couchbase_ext/stats.c
221
195
  - ext/couchbase_ext/store.c
@@ -229,6 +203,7 @@ files:
229
203
  - lib/couchbase.rb
230
204
  - lib/couchbase/bucket.rb
231
205
  - lib/couchbase/cluster.rb
206
+ - lib/couchbase/constants.rb
232
207
  - lib/couchbase/result.rb
233
208
  - lib/couchbase/utils.rb
234
209
  - lib/couchbase/version.rb
@@ -238,7 +213,6 @@ files:
238
213
  - lib/rack/session/couchbase.rb
239
214
  - tasks/benchmark.rake
240
215
  - tasks/compile.rake
241
- - tasks/doc.rake
242
216
  - tasks/test.rake
243
217
  - tasks/util.rake
244
218
  - test/profile/.gitignore
@@ -253,6 +227,7 @@ files:
253
227
  - test/test_couchbase_rails_cache_store.rb
254
228
  - test/test_delete.rb
255
229
  - test/test_errors.rb
230
+ - test/test_eventmachine.rb
256
231
  - test/test_format.rb
257
232
  - test/test_get.rb
258
233
  - test/test_stats.rb
@@ -280,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
280
255
  version: '0'
281
256
  segments:
282
257
  - 0
283
- hash: 1784186520908276694
258
+ hash: 3150309656222985130
284
259
  required_rubygems_version: !ruby/object:Gem::Requirement
285
260
  none: false
286
261
  requirements:
@@ -289,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
289
264
  version: '0'
290
265
  segments:
291
266
  - 0
292
- hash: 1784186520908276694
267
+ hash: 3150309656222985130
293
268
  requirements: []
294
269
  rubyforge_project:
295
270
  rubygems_version: 1.8.23
data/tasks/doc.rake DELETED
@@ -1,27 +0,0 @@
1
- # Author:: Couchbase <info@couchbase.com>
2
- # Copyright:: 2011, 2012 Couchbase, Inc.
3
- # License:: Apache License, Version 2.0
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
- #
17
-
18
- require 'rake/clean'
19
- require 'yard'
20
- require 'yard/rake/yardoc_task'
21
-
22
- YARD::Rake::YardocTask.new do |t|
23
- t.options = %w(--protected --no-private)
24
- t.files.push('-', 'README.markdown', 'HISTORY.markdown')
25
- end
26
-
27
- #CLOBBER << 'test/CouchbaseMock.jar'