couchbase 1.3.4-x64-mingw32 → 1.3.5-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1cc85fb86da92840fadcda23fd9961a45165306
4
- data.tar.gz: 47844601752a2dcc335681043f5e766b70042fd8
3
+ metadata.gz: 25299cfbd8ed2b7f10c7277c0baa1cea56c9c156
4
+ data.tar.gz: 64006afc2453b86457b46065dd12e780857b54c1
5
5
  SHA512:
6
- metadata.gz: 3c20878cbf421d74cba350c578020adc7f8e82a711ad37bbfc772f9aadf15856765e5201b77f4b78de5710a6f97ef0ad63aee1648001df5987b4ea4d24efd225
7
- data.tar.gz: 2f2190494a0bb4531c5f2315c91f81f524361b6d5a9a017c2766d4405dc509ab6a81957ec7bcd5378e61db609ec936826a626d029e04e3e51954d7fe1e479731
6
+ metadata.gz: 44d9c21cd42db3f322fe5af1db00c0084ecde24467109d7971c4a097c637926157cc92df9b00a26603dd949dc2fce8999d946a3dedf921597c9803c2ce14d0d2
7
+ data.tar.gz: 845496d39d0a1b870a494cd782c95944b1566a6e7642283b97adf31b527b2991820d7105ff40b12f03a130e94bcd8a037f706d2ac1d69e67de5121e0c7f44ed1
@@ -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: x64-mingw32
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