couchbase 1.3.9-x64-mingw32 → 1.3.10-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: df9e11b3246e5b4f24575b1075bf0fb7b7e661b5
4
- data.tar.gz: deba9b0e6bb6fdb5f9236ba89324b060255305ce
3
+ metadata.gz: c636d9da0367a9547194dcaa01e6ec77e862427b
4
+ data.tar.gz: af789110cd5ed3b2bc26eb288f06a862bba15b56
5
5
  SHA512:
6
- metadata.gz: 8c6ce70d4d7f98591c7a9856b44f730cf4b177b486fe7a67ad883d51dedddf95a8f05af0a67308ca4b2c29e2213d40b940fe5257407c07b3222c7cc200fc4f17
7
- data.tar.gz: 49f7f6ca7db4d88e94efac86cb140bf411234f40e89a80a21644bc04a3e63d5fc609cc230a113d5f869f2922e16e05d9dfb53736045de78dd1599e527ed7d0d8
6
+ metadata.gz: 5c38100885c69a9b32433dbda52397e6c3606081b9659be8b4b5dc0fe4b89a2807de3ef950622d4e17e9545ec1b866f9d6eeee04341ae9fcff4ed4ce02b2aafc
7
+ data.tar.gz: 397faa69ebca25a0a21f6d5a7e7f8d446f711d37842ab4809ed259c77ed185fc443d8088b89ba1f724491d91f1d8c9d0ca8e302c6863cfc3bd3f691b463ab1ba
@@ -29,9 +29,19 @@ Couchbase's fork: https://github.com/couchbase/homebrew
29
29
 
30
30
  $ brew install https://raw.github.com/couchbase/homebrew/preview/Library/Formula/libcouchbase.rb
31
31
 
32
- If you are experience issues with installing using system ruby, you
33
- might try to use [rbenv][rbenv], and install couchbase there. Here are
34
- the steps:
32
+ If you are experiencing issues with installing using the OS included
33
+ ruby, the most likely reason is that architecture of libcouchbase and
34
+ your ruby do not match (e.g. one component is fat binary while another
35
+ is not). The best fix depends on the details of the components. If you
36
+ are using the system ruby on Mac OS X (which contains both 32-bit and
37
+ 64-bit code), you need to install libcouchbase using the `--universal`
38
+ option:
39
+
40
+ $ brew install --universal libcouchbase
41
+
42
+ Another approach might be to try to use [rbenv][rbenv], install 64-bit
43
+ only ruby and compile couchbase ruby gem there there. Here are the
44
+ steps:
35
45
 
36
46
  $ brew install rbenv ruby-build
37
47
 
@@ -44,7 +54,7 @@ Then install ruby and make it global:
44
54
  $ rbenv install 2.1.2
45
55
  $ rbenv global 2.1.2
46
56
 
47
- Now you are ready to install and use couchbase ruby gem as usual:
57
+ Now you are ready to install and use the couchbase ruby gem:
48
58
 
49
59
  $ gem install couchbase
50
60
 
@@ -3,6 +3,14 @@
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.10 (2014-09-30)
7
+
8
+ * [major] Updates regarding libcouchbase 2.4.2. Bundle "bsdio-inl.c"
9
+ which is not part of libcouchbase distribution anymore. This fixes
10
+ installation recent ruby gem versions with libcouchbase 2.4.2.
11
+
12
+ * [minor] Allow both `:hostname` and `:host` options to constructor
13
+
6
14
  ## 1.3.9 (2014-08-26)
7
15
 
8
16
  * [major] Updates regarding libcouchbase 2.4.0. Deprecations cleanup
@@ -182,6 +182,11 @@ do_scan_connection_options(struct cb_bucket_st *bucket, int argc, VALUE *argv)
182
182
  arg = rb_hash_aref(opts, cb_sym_hostname);
183
183
  if (arg != Qnil) {
184
184
  bucket->hostname = rb_str_dup_frozen(StringValue(arg));
185
+ } else {
186
+ arg = rb_hash_aref(opts, cb_sym_host);
187
+ if (arg != Qnil) {
188
+ bucket->hostname = rb_str_dup_frozen(StringValue(arg));
189
+ }
185
190
  }
186
191
  arg = rb_hash_aref(opts, cb_sym_pool);
187
192
  if (arg != Qnil) {
@@ -476,8 +481,8 @@ cb_bucket_alloc(VALUE klass)
476
481
  * to. If specified it takes precedence over +:host+ option. The list
477
482
  * must be array of strings in form of host names or host names with
478
483
  * ports (in first case port 8091 will be used, see examples).
479
- * @option options [String] :host ("localhost") the hostname or IP address
480
- * of the node
484
+ * @option options [String] :hostname ("localhost") the hostname or
485
+ * IP address of the node
481
486
  * @option options [Fixnum] :port (8091) the port of the managemenent API
482
487
  * @option options [String] :pool ("default") the pool name
483
488
  * @option options [String] :bucket ("default") the bucket name
@@ -71,6 +71,7 @@ ID cb_sym_forced;
71
71
  ID cb_sym_format;
72
72
  ID cb_sym_found;
73
73
  ID cb_sym_get;
74
+ ID cb_sym_host;
74
75
  ID cb_sym_hostname;
75
76
  ID cb_sym_http;
76
77
  ID cb_sym_http_request;
@@ -1318,6 +1319,7 @@ Init_couchbase_ext(void)
1318
1319
  cb_sym_format = ID2SYM(rb_intern("format"));
1319
1320
  cb_sym_found = ID2SYM(rb_intern("found"));
1320
1321
  cb_sym_get = ID2SYM(rb_intern("get"));
1322
+ cb_sym_host = ID2SYM(rb_intern("host"));
1321
1323
  cb_sym_hostname = ID2SYM(rb_intern("hostname"));
1322
1324
  cb_sym_http = ID2SYM(rb_intern("http"));
1323
1325
  cb_sym_http_request = ID2SYM(rb_intern("http_request"));
@@ -233,6 +233,7 @@ extern ID cb_sym_forced;
233
233
  extern ID cb_sym_format;
234
234
  extern ID cb_sym_found;
235
235
  extern ID cb_sym_get;
236
+ extern ID cb_sym_host;
236
237
  extern ID cb_sym_hostname;
237
238
  extern ID cb_sym_http;
238
239
  extern ID cb_sym_http_request;
@@ -20,7 +20,7 @@
20
20
  #ifndef _WIN32
21
21
  #ifdef BUILD_EVENTMACHINE_PLUGIN
22
22
 
23
- #include <libcouchbase/bsdio-inl.c>
23
+ #include "libcouchbase/bsdio-inl.c"
24
24
 
25
25
  VALUE cb_mEm;
26
26
  VALUE cb_cEmSocket;
@@ -82,7 +82,7 @@ else
82
82
  ]
83
83
 
84
84
  # For people using homebrew
85
- brew_prefix = `brew --prefix libevent 2> /dev/null`.chomp
85
+ brew_prefix = `brew --prefix libcouchbase 2> /dev/null`.chomp
86
86
  unless brew_prefix.empty?
87
87
  LIB_DIRS.unshift File.join(brew_prefix, 'lib')
88
88
  HEADER_DIRS.unshift File.join(brew_prefix, 'include')
@@ -0,0 +1,223 @@
1
+ /**
2
+ * Inline routines for common 'BSD'-style I/O for plugins.
3
+ *
4
+ * Include this file in your plugin and then call wire_lcb_bsd_impl on the
5
+ * plugin instance.
6
+ */
7
+
8
+ static void
9
+ wire_lcb_bsd_impl(lcb_io_opt_t io);
10
+
11
+ #ifdef _WIN32
12
+ #include "wsaerr-inl.c"
13
+ static int
14
+ get_wserr(lcb_socket_t sock)
15
+ {
16
+ DWORD error = WSAGetLastError();
17
+ int ext = 0;
18
+ int len = sizeof(ext);
19
+
20
+ /* Retrieves extended error status and clear */
21
+ getsockopt(sock, SOL_SOCKET, SO_ERROR, (char *)&ext, &len);
22
+ return wsaerr_map_impl(error);
23
+ }
24
+
25
+ static lcb_ssize_t
26
+ recvv_impl(lcb_io_opt_t iops, lcb_socket_t sock,
27
+ struct lcb_iovec_st *iov, lcb_size_t niov)
28
+ {
29
+ DWORD flags = 0, nr;
30
+ WSABUF *bufptr = (WSABUF *)iov;
31
+
32
+ if (WSARecv(sock, bufptr, niov, &nr, &flags, NULL, NULL) == SOCKET_ERROR) {
33
+ iops->v.v0.error = get_wserr(sock);
34
+ if (iops->v.v0.error == ECONNRESET) {
35
+ return 0;
36
+ }
37
+ return -1;
38
+ }
39
+
40
+ (void)iops;
41
+ return (lcb_ssize_t)nr;
42
+ }
43
+
44
+ static lcb_ssize_t
45
+ recv_impl(lcb_io_opt_t iops, lcb_socket_t sock, void *buf, lcb_size_t nbuf,
46
+ int fl_unused)
47
+ {
48
+ WSABUF iov;
49
+ iov.len = nbuf;
50
+ iov.buf = buf;
51
+ (void)fl_unused;
52
+ return recvv_impl(iops, sock, (struct lcb_iovec_st *)&iov, 1);
53
+ }
54
+
55
+ static lcb_ssize_t
56
+ sendv_impl(lcb_io_opt_t iops, lcb_socket_t sock, struct lcb_iovec_st *iov,
57
+ lcb_size_t niov)
58
+ {
59
+ DWORD nw, fl = 0;
60
+ WSABUF *bufptr = (WSABUF *)iov;
61
+ if (WSASend(sock, bufptr, niov, &nw, fl, NULL, NULL) == SOCKET_ERROR) {
62
+ iops->v.v0.error = get_wserr(sock);
63
+ return -1;
64
+ }
65
+ return (lcb_ssize_t)nw;
66
+ }
67
+
68
+ static lcb_ssize_t
69
+ send_impl(lcb_io_opt_t iops, lcb_socket_t sock, const void *buf, lcb_size_t nbuf,
70
+ int flags)
71
+ {
72
+ WSABUF iov;
73
+ iov.buf = (void *)buf;
74
+ iov.len = nbuf;
75
+ (void)flags;
76
+ return sendv_impl(iops, sock, (struct lcb_iovec_st *)&iov, 1);
77
+ }
78
+
79
+ #else
80
+ static lcb_ssize_t
81
+ recvv_impl(lcb_io_opt_t iops, lcb_socket_t sock, struct lcb_iovec_st *iov,
82
+ lcb_size_t niov)
83
+ {
84
+ struct msghdr mh;
85
+ lcb_ssize_t ret;
86
+
87
+ memset(&mh, 0, sizeof(mh));
88
+ mh.msg_iov = (struct iovec *)iov;
89
+ mh.msg_iovlen = niov;
90
+ ret = recvmsg(sock, &mh, 0);
91
+ if (ret < 0) {
92
+ iops->v.v0.error = errno;
93
+ }
94
+ return ret;
95
+ }
96
+
97
+ static lcb_ssize_t
98
+ recv_impl(lcb_io_opt_t iops, lcb_socket_t sock, void *buf, lcb_size_t nbuf,
99
+ int flags)
100
+ {
101
+ lcb_ssize_t ret = recv(sock, buf, nbuf, flags);
102
+ if (ret < 0) {
103
+ iops->v.v0.error = errno;
104
+ }
105
+ return ret;
106
+ }
107
+
108
+ static lcb_ssize_t
109
+ sendv_impl(lcb_io_opt_t iops, lcb_socket_t sock, struct lcb_iovec_st *iov,
110
+ lcb_size_t niov)
111
+ {
112
+ struct msghdr mh;
113
+ lcb_ssize_t ret;
114
+
115
+ memset(&mh, 0, sizeof(mh));
116
+ mh.msg_iov = (struct iovec *)iov;
117
+ mh.msg_iovlen = niov;
118
+ ret = sendmsg(sock, &mh, 0);
119
+ if (ret < 0) {
120
+ iops->v.v0.error = errno;
121
+ }
122
+ return ret;
123
+ }
124
+
125
+ static lcb_ssize_t
126
+ send_impl(lcb_io_opt_t iops, lcb_socket_t sock, const void *buf, lcb_size_t nbuf,
127
+ int flags)
128
+ {
129
+ lcb_ssize_t ret = send(sock, buf, nbuf, flags);
130
+ if (ret < 0) {
131
+ iops->v.v0.error = errno;
132
+ }
133
+ return ret;
134
+ }
135
+
136
+ #endif
137
+
138
+ static int make_socket_nonblocking(lcb_socket_t sock)
139
+ {
140
+ #ifdef _WIN32
141
+ u_long nonblocking = 1;
142
+ if (ioctlsocket(sock, FIONBIO, &nonblocking) == SOCKET_ERROR) {
143
+ return -1;
144
+ }
145
+ #else
146
+ int flags;
147
+ if ((flags = fcntl(sock, F_GETFL, NULL)) < 0) {
148
+ return -1;
149
+ }
150
+ if (fcntl(sock, F_SETFL, flags | O_NONBLOCK) == -1) {
151
+ return -1;
152
+ }
153
+ #endif
154
+ return 0;
155
+ }
156
+
157
+ static lcb_socket_t
158
+ socket_impl(lcb_io_opt_t iops, int domain, int type, int protocol)
159
+ {
160
+ lcb_socket_t sock;
161
+ #ifdef _WIN32
162
+ sock = (lcb_socket_t)WSASocket(domain, type, protocol, NULL, 0, 0);
163
+ #else
164
+ sock = socket(domain, type, protocol);
165
+ #endif
166
+ if (sock == INVALID_SOCKET) {
167
+ iops->v.v0.error = errno;
168
+ } else {
169
+ if (make_socket_nonblocking(sock) != 0) {
170
+ #ifdef _WIN32
171
+ iops->v.v0.error = get_wserr(sock);
172
+ #else
173
+ iops->v.v0.error = errno;
174
+ #endif
175
+ iops->v.v0.close(iops, sock);
176
+ sock = INVALID_SOCKET;
177
+ }
178
+ }
179
+ return sock;
180
+ }
181
+
182
+ static void
183
+ close_impl(lcb_io_opt_t iops, lcb_socket_t sock)
184
+ {
185
+ (void)iops;
186
+ #ifdef _WIN32
187
+ closesocket(sock);
188
+ #else
189
+ close(sock);
190
+ #endif
191
+ }
192
+
193
+ static int
194
+ connect_impl(lcb_io_opt_t iops, lcb_socket_t sock, const struct sockaddr *name,
195
+ unsigned int namelen)
196
+ {
197
+ int ret;
198
+
199
+ #ifdef _WIN32
200
+ ret = WSAConnect(sock, name, (int)namelen, NULL, NULL, NULL, NULL);
201
+ if (ret == SOCKET_ERROR) {
202
+ iops->v.v0.error = get_wserr(sock);
203
+ }
204
+ #else
205
+ ret = connect(sock, name, (socklen_t)namelen);
206
+ if (ret < 0) {
207
+ iops->v.v0.error = errno;
208
+ }
209
+ #endif
210
+ return ret;
211
+ }
212
+
213
+ static void
214
+ wire_lcb_bsd_impl(lcb_io_opt_t io)
215
+ {
216
+ io->v.v0.recv = recv_impl;
217
+ io->v.v0.recvv = recvv_impl;
218
+ io->v.v0.send = send_impl;
219
+ io->v.v0.sendv = sendv_impl;
220
+ io->v.v0.socket = socket_impl;
221
+ io->v.v0.connect = connect_impl;
222
+ io->v.v0.close = close_impl;
223
+ }
@@ -27,7 +27,7 @@
27
27
  #include <poll.h>
28
28
  #endif
29
29
 
30
- #include <libcouchbase/bsdio-inl.c>
30
+ #include "libcouchbase/bsdio-inl.c"
31
31
 
32
32
  /* events sorted array */
33
33
  typedef struct rb_mt_event rb_mt_event;
@@ -17,5 +17,5 @@
17
17
 
18
18
  # Couchbase ruby client
19
19
  module Couchbase
20
- VERSION = "1.3.9"
20
+ VERSION = "1.3.10"
21
21
  end
@@ -285,4 +285,15 @@ class TestBucket < MiniTest::Test
285
285
  assert double.connected?, "duplicate connection should be alive"
286
286
  end
287
287
  end
288
+
289
+ def test_it_accepts_both_hostname_and_host_options
290
+ with_mock do |mock|
291
+ connection = Couchbase.new(:hostname => mock.host, :port => mock.port)
292
+ assert_equal mock.host, connection.hostname
293
+
294
+ connection = Couchbase.new(:host => mock.host, :port => mock.port)
295
+ assert_equal mock.host, connection.hostname
296
+ end
297
+ end
298
+
288
299
  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.9
4
+ version: 1.3.10
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-08-26 00:00:00.000000000 Z
11
+ date: 2014-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yaji
@@ -243,6 +243,7 @@ files:
243
243
  - ext/couchbase_ext/get.c
244
244
  - ext/couchbase_ext/gethrtime.c
245
245
  - ext/couchbase_ext/http.c
246
+ - ext/couchbase_ext/libcouchbase/bsdio-inl.c
246
247
  - ext/couchbase_ext/multithread_plugin.c
247
248
  - ext/couchbase_ext/observe.c
248
249
  - ext/couchbase_ext/result.c