couchbase 1.3.9-x86-mingw32 → 1.3.10-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +14 -4
- data/RELEASE_NOTES.markdown +8 -0
- data/ext/couchbase_ext/bucket.c +7 -2
- data/ext/couchbase_ext/couchbase_ext.c +2 -0
- data/ext/couchbase_ext/couchbase_ext.h +1 -0
- data/ext/couchbase_ext/eventmachine_plugin.c +1 -1
- data/ext/couchbase_ext/extconf.rb +1 -1
- data/ext/couchbase_ext/libcouchbase/bsdio-inl.c +223 -0
- data/ext/couchbase_ext/multithread_plugin.c +1 -1
- data/lib/couchbase/version.rb +1 -1
- data/test/test_bucket.rb +11 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ecb0e2c259c3f04b2f5b51483c3bb0768f8921f
|
4
|
+
data.tar.gz: ff5b635f6a6dc3aae13984cfe40904bf462a4b02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f900b51c9a37bc82bf6f985ac5b79bd9e0bc48d17f4d4bff029c8bb301e87e9b9c2d63e9c4ad6e53642fb18459331f3c86f82007f2c0e8dbae7db59663bf613
|
7
|
+
data.tar.gz: 6920265e6087ca7e50a7036eccb5b5b0c0ab9d5dd8b8c34f5d621dc6bdbfe91f7ea354ec82dd87d5cdf088e2212ceb7e2a80dc3bd99f02bd7733acb2c13c60e5
|
data/README.markdown
CHANGED
@@ -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
|
33
|
-
|
34
|
-
|
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
|
57
|
+
Now you are ready to install and use the couchbase ruby gem:
|
48
58
|
|
49
59
|
$ gem install couchbase
|
50
60
|
|
data/RELEASE_NOTES.markdown
CHANGED
@@ -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
|
data/ext/couchbase_ext/bucket.c
CHANGED
@@ -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] :
|
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"));
|
@@ -82,7 +82,7 @@ else
|
|
82
82
|
]
|
83
83
|
|
84
84
|
# For people using homebrew
|
85
|
-
brew_prefix = `brew --prefix
|
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
|
+
}
|
data/lib/couchbase/version.rb
CHANGED
data/test/test_bucket.rb
CHANGED
@@ -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.
|
4
|
+
version: 1.3.10
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Couchbase
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
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
|