couchbase 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MzUyYTFlYjFlYTg1MWQ3Y2E2YWViNmRjZTc3MTZmNzZjMDBkZThiZg==
5
- data.tar.gz: !binary |-
6
- ZGM2ZDgwNGI5NTE0YWZkODJkZTlmOWFlMWU3NWIzMzY4MTExNmE1YQ==
2
+ SHA1:
3
+ metadata.gz: 997ac87419c7305101ce2f9c13e90c90ba7ad648
4
+ data.tar.gz: b59ac0259606d777c9025701da72ec9f72d0d8b4
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YzFjNmM4ZDFkMGIyZDk0YzQ0ZGIzZDY0OGVlNGZhNjEwNDIyY2M0NDdlYTZj
10
- MTIwZTRlMGQ1MWEzNzc0OTNlZTU1YjUzNjY5OTNlZTZjNDYxNTVkYzc1ZDBk
11
- MzJiZWQ1M2Y2MmZiNDc3YzU1MGRiNWRlOTQ3ZTVmMDI3OTQ4OTk=
12
- data.tar.gz: !binary |-
13
- NDdkMTRhYjEyMDcxMmQ0MzY4ODM4Mjk1ZDY2NDZiZWM0YmYwNzQ4NzEyMjY2
14
- OGQ0NzdmYTM4ZTQzNzczYjkxNWFlZTQ4NjIwZDdmMGUxYTRiYTE2OGVkNWFk
15
- YWUzMjRlZGQ4NTUxY2NkNzFkYTBjODlhYzY3YWFiYTkwODY4ZWU=
6
+ metadata.gz: a09a68fc64b558e17f1d0fc51e26f08f9a101b845da4240b4dd46e282c74e253062ba73325311d89d487a8b517a75186192fb338dd23072475969fcf8a17ee48
7
+ data.tar.gz: 23e9e3e6cf81fdb10ca726506e5f15a257aab9da39fb8fe39cc8361eaf64ead695b58740bcfd6605c85a4175c0294dbf5a8d2153cf8aa13317241566415ce3d7
@@ -9,10 +9,10 @@ are related libraries available:
9
9
  ## SUPPORT
10
10
 
11
11
  If you find an issue, please file it in our [JIRA][1]. Also you are
12
- always welcome on the `#libcouchbase` channel at [freenode.net IRC servers][2].
12
+ always welcome on the `#libcouchbase` channel at [freenode.net IRC
13
+ servers][2]. Checkout [library overview][overview] and [API
14
+ documentation][api].
13
15
 
14
- Documentation: [http://docs.couchbase.com/couchbase-sdk-ruby-1.3/](http://docs.couchbase.com/couchbase-sdk-ruby-1.3/)
15
- API Documentation: [http://www.couchbase.com/autodocs/](http://www.couchbase.com/autodocs/)
16
16
 
17
17
  ## INSTALL
18
18
 
@@ -95,6 +95,9 @@ Now install the couchbase gem itself
95
95
 
96
96
  $ gem install couchbase
97
97
 
98
+ The library verified with all major ruby versions: 1.8.7, 1.9.3, 2.0,
99
+ 2.1.
100
+
98
101
  ## USAGE
99
102
 
100
103
  First, you need to load the library:
@@ -635,6 +638,8 @@ task and you will find all artifacts in `pkg/` directory:
635
638
  pkg/couchbase-1.3.4-x86-mingw32.gem
636
639
 
637
640
 
641
+ [api]: http://www.couchbase.com/autodocs/couchbase-ruby-client-1.3.4/index.html
642
+ [overview]: http://docs.couchbase.com/couchbase-sdk-ruby-1.3/index.html
638
643
  [1]: http://couchbase.com/issues/browse/RCBC
639
644
  [2]: http://freenode.net/irc_servers.shtml
640
645
  [3]: http://www.couchbase.com/develop/c/current
@@ -3,6 +3,24 @@
3
3
  This document is a list of user visible feature changes and important
4
4
  bugfixes. Do not forget to update this doc in every important patch.
5
5
 
6
+ ## 1.3.5 (2014-02-05)
7
+
8
+ * [major] RCBC-159, RCBC-152 Honor the :environment constructor argument
9
+
10
+ * [major] Allow inheritance from `Couchbase::Bucket`. It wasn't
11
+ possible to create a view with subclass of the `Couchbase::Bucket`.
12
+
13
+ * [major] Ensure that an exception raised early will not prevent the
14
+ finalizer from being called in the underlying client being constructed.
15
+ One example situation where this could occur:
16
+
17
+ class Couchbase::Bucket
18
+ def initialize(*args)
19
+ raise "something wrong"
20
+ super
21
+ end
22
+ end
23
+
6
24
  ## 1.3.4 (2014-01-08)
7
25
 
8
26
  * [major] Build 64-bit versions of the extensions for Windows
@@ -136,10 +136,9 @@ cb_bucket_arithmetic(int sign, int argc, VALUE *argv, VALUE self)
136
136
  * provided at the protocol level. This simplifies what would otherwise be a
137
137
  * two-stage get and set operation.
138
138
  *
139
- * @note that server values stored and transmitted as unsigned numbers,
140
- * therefore if you try to store negative number and then increment or
141
- * decrement it will cause overflow. (see "Integer overflow" example
142
- * below)
139
+ * @note that server treats values as unsigned numbers, therefore if
140
+ * you try to store negative number and then increment or decrement it
141
+ * will cause overflow. (see "Integer overflow" example below)
143
142
  *
144
143
  * @overload incr(key, delta = 1, options = {})
145
144
  * @param key [String, Symbol] Key used to reference the value.
@@ -194,6 +193,16 @@ cb_bucket_arithmetic(int sign, int argc, VALUE *argv, VALUE self)
194
193
  * c.set("foo", -100)
195
194
  * c.get("foo") #=> -100
196
195
  * c.incr("foo") #=> 18446744073709551517
196
+ * # but it might look like working
197
+ * c.set("foo", -2)
198
+ * c.get("foo") #=> -2
199
+ * c.incr("foo", 2) #=> 0
200
+ * # on server:
201
+ * # // UINT64_MAX is 18446744073709551615
202
+ * # uint64_t num = atoll("-2");
203
+ * # // num is 18446744073709551614
204
+ * # num += 2
205
+ * # // num is 0
197
206
  *
198
207
  * @example Asynchronous invocation
199
208
  * c.run do
@@ -69,7 +69,9 @@ cb_bucket_free(void *ptr)
69
69
  lcb_destroy(bucket->handle);
70
70
  lcb_destroy_io_ops(bucket->io);
71
71
  }
72
- st_free_table(bucket->object_space);
72
+ if (bucket->object_space) {
73
+ st_free_table(bucket->object_space);
74
+ }
73
75
  xfree(bucket);
74
76
  }
75
77
  }
@@ -242,6 +244,7 @@ do_scan_connection_options(struct cb_bucket_st *bucket, int argc, VALUE *argv)
242
244
  if (arg != Qundef) {
243
245
  cb_bucket_transcoder_set(bucket->self, arg);
244
246
  }
247
+ arg = rb_hash_aref(opts, cb_sym_environment);
245
248
  if (arg != Qnil) {
246
249
  if (arg == cb_sym_production || arg == cb_sym_development) {
247
250
  bucket->environment = arg;
@@ -206,7 +206,7 @@ cb_http_request_init(int argc, VALUE *argv, VALUE self)
206
206
  if (NIL_P(on_body) && rb_block_given_p()) {
207
207
  on_body = rb_block_proc();
208
208
  }
209
- if (CLASS_OF(bucket) != cb_cBucket) {
209
+ if (!RTEST(rb_obj_is_kind_of(bucket, cb_cBucket))) {
210
210
  rb_raise(rb_eTypeError, "wrong argument type (expected Couchbase::Bucket)");
211
211
  }
212
212
  memset(&request->cmd, 0, sizeof(lcb_http_cmd_t));
@@ -62,7 +62,7 @@ cb_result_inspect(VALUE self)
62
62
  }
63
63
 
64
64
  attr = rb_attr_get(self, cb_id_iv_value);
65
- if (RTEST(attr) && rb_obj_is_kind_of(attr, cb_cBucket)) {
65
+ if (RTEST(attr) && RTEST(rb_obj_is_kind_of(attr, cb_cBucket))) {
66
66
  rb_str_buf_cat2(str, " bucket="); /* value also accessible using alias #bucket */
67
67
  rb_str_append(str, rb_inspect(attr));
68
68
  }
@@ -169,7 +169,7 @@ cb_timer_init(int argc, VALUE *argv, VALUE self)
169
169
  rb_need_block();
170
170
  rb_scan_args(argc, argv, "21&", &bucket, &timeout, &opts, &cb);
171
171
 
172
- if (CLASS_OF(bucket) != cb_cBucket) {
172
+ if (!RTEST(rb_obj_is_kind_of(bucket, cb_cBucket))) {
173
173
  rb_raise(rb_eTypeError, "wrong argument type (expected Couchbase::Bucket)");
174
174
  }
175
175
  tm->self = self;
@@ -17,5 +17,5 @@
17
17
 
18
18
  # Couchbase ruby client
19
19
  module Couchbase
20
- VERSION = "1.3.4"
20
+ VERSION = "1.3.5"
21
21
  end
@@ -247,4 +247,30 @@ class TestBucket < MiniTest::Test
247
247
  GC.start # make sure it won't touch handle in finalizer
248
248
  end
249
249
 
250
+ def test_it_accepts_environment_option
251
+ with_mock do |mock|
252
+ connection = Couchbase.new(:hostname => mock.host,
253
+ :port => mock.port,
254
+ :environment => :development)
255
+ assert_equal :development, connection.environment
256
+ end
257
+ end
258
+
259
+ def test_it_defaults_to_production_environment
260
+ with_mock do |mock|
261
+ connection = Couchbase.new(:hostname => mock.host,
262
+ :port => mock.port)
263
+ assert_equal :production, connection.environment
264
+ end
265
+ end
266
+
267
+ def test_it_uses_default_environment_if_unknown_was_specified
268
+ with_mock do |mock|
269
+ connection = Couchbase.new(:hostname => mock.host,
270
+ :port => mock.port,
271
+ :environment => :foobar)
272
+ assert_equal :production, connection.environment
273
+ end
274
+ end
275
+
250
276
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Couchbase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-08 00:00:00.000000000 Z
11
+ date: 2014-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yaji
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.3'
20
- - - ! '>='
20
+ - - '>='
21
21
  - !ruby/object:Gem::Version
22
22
  version: 0.3.2
23
23
  type: :runtime
@@ -27,7 +27,7 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0.3'
30
- - - ! '>='
30
+ - - '>='
31
31
  - !ruby/object:Gem::Version
32
32
  version: 0.3.2
33
33
  - !ruby/object:Gem::Dependency
@@ -51,7 +51,7 @@ dependencies:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
53
  version: '1.0'
54
- - - ! '>='
54
+ - - '>='
55
55
  - !ruby/object:Gem::Version
56
56
  version: 1.0.0
57
57
  type: :runtime
@@ -61,21 +61,21 @@ dependencies:
61
61
  - - ~>
62
62
  - !ruby/object:Gem::Version
63
63
  version: '1.0'
64
- - - ! '>='
64
+ - - '>='
65
65
  - !ruby/object:Gem::Version
66
66
  version: 1.0.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: rake
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ! '>='
71
+ - - '>='
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ! '>='
78
+ - - '>='
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  - !ruby/object:Gem::Dependency
@@ -85,7 +85,7 @@ dependencies:
85
85
  - - ~>
86
86
  - !ruby/object:Gem::Version
87
87
  version: '5.0'
88
- - - ! '>='
88
+ - - '>='
89
89
  - !ruby/object:Gem::Version
90
90
  version: 5.0.4
91
91
  type: :development
@@ -95,7 +95,7 @@ dependencies:
95
95
  - - ~>
96
96
  - !ruby/object:Gem::Version
97
97
  version: '5.0'
98
- - - ! '>='
98
+ - - '>='
99
99
  - !ruby/object:Gem::Version
100
100
  version: 5.0.4
101
101
  - !ruby/object:Gem::Dependency
@@ -105,7 +105,7 @@ dependencies:
105
105
  - - ~>
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0.7'
108
- - - ! '>='
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: 0.7.5
111
111
  type: :development
@@ -115,7 +115,7 @@ dependencies:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0.7'
118
- - - ! '>='
118
+ - - '>='
119
119
  - !ruby/object:Gem::Version
120
120
  version: 0.7.5
121
121
  - !ruby/object:Gem::Dependency
@@ -125,7 +125,7 @@ dependencies:
125
125
  - - ~>
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0.5'
128
- - - ! '>='
128
+ - - '>='
129
129
  - !ruby/object:Gem::Version
130
130
  version: 0.5.2
131
131
  type: :development
@@ -135,7 +135,7 @@ dependencies:
135
135
  - - ~>
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0.5'
138
- - - ! '>='
138
+ - - '>='
139
139
  - !ruby/object:Gem::Version
140
140
  version: 0.5.2
141
141
  - !ruby/object:Gem::Dependency
@@ -145,7 +145,7 @@ dependencies:
145
145
  - - ~>
146
146
  - !ruby/object:Gem::Version
147
147
  version: '1.1'
148
- - - ! '>='
148
+ - - '>='
149
149
  - !ruby/object:Gem::Version
150
150
  version: 1.1.0
151
151
  type: :development
@@ -155,35 +155,35 @@ dependencies:
155
155
  - - ~>
156
156
  - !ruby/object:Gem::Version
157
157
  version: '1.1'
158
- - - ! '>='
158
+ - - '>='
159
159
  - !ruby/object:Gem::Version
160
160
  version: 1.1.0
161
161
  - !ruby/object:Gem::Dependency
162
162
  name: active_support
163
163
  requirement: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - ! '>='
165
+ - - '>='
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  type: :development
169
169
  prerelease: false
170
170
  version_requirements: !ruby/object:Gem::Requirement
171
171
  requirements:
172
- - - ! '>='
172
+ - - '>='
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  - !ruby/object:Gem::Dependency
176
176
  name: eventmachine
177
177
  requirement: !ruby/object:Gem::Requirement
178
178
  requirements:
179
- - - ! '>='
179
+ - - '>='
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  type: :development
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
185
185
  requirements:
186
- - - ! '>='
186
+ - - '>='
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  description: The official client library for use with Couchbase Server.
@@ -293,17 +293,17 @@ require_paths:
293
293
  - lib
294
294
  required_ruby_version: !ruby/object:Gem::Requirement
295
295
  requirements:
296
- - - ! '>='
296
+ - - '>='
297
297
  - !ruby/object:Gem::Version
298
298
  version: '0'
299
299
  required_rubygems_version: !ruby/object:Gem::Requirement
300
300
  requirements:
301
- - - ! '>='
301
+ - - '>='
302
302
  - !ruby/object:Gem::Version
303
303
  version: '0'
304
304
  requirements: []
305
305
  rubyforge_project:
306
- rubygems_version: 2.2.1
306
+ rubygems_version: 2.0.14
307
307
  signing_key:
308
308
  specification_version: 4
309
309
  summary: Couchbase ruby driver