libcouchbase 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/libcouchbase/bucket.rb +10 -3
- data/lib/libcouchbase/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb45eb8d450b1b10b14d63bf0d3df86421140ff8
|
4
|
+
data.tar.gz: 6eb74d3ca61e481106b9b5ec58429c33808985aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0500cdf5fb26590f8e219e35baac537e51d5acd3ea691678bb98527b6b8d22cd3d599060e2edfa7bc9cbe6f6d115c4bb6154e97ff6509a7cdf98f1579d26f420
|
7
|
+
data.tar.gz: 99d90632602e151801fdc3f87276b7692579e5f6473310d049ae8ddc51aebfc51cc040d2008b8c588e1476104ba9e949158bf4017963eb2a3fc4fb0f185e1ba5
|
data/lib/libcouchbase/bucket.rb
CHANGED
@@ -84,8 +84,10 @@ module Libcouchbase
|
|
84
84
|
#
|
85
85
|
# @example Get and lock multiple keys using custom timeout
|
86
86
|
# c.get("foo", "bar", lock: 3)
|
87
|
-
def get(*keys, extended: false, async: false, quiet: @quiet, assemble_hash: false, **opts)
|
88
|
-
|
87
|
+
def get(key, *keys, extended: false, async: false, quiet: @quiet, assemble_hash: false, **opts)
|
88
|
+
was_array = key.respond_to?(:to_a) || keys.length > 0
|
89
|
+
keys.unshift Array(key) # Convert enumerables
|
90
|
+
keys.flatten! # Ensure we're left with a list of keys
|
89
91
|
|
90
92
|
if keys.length == 1
|
91
93
|
promise = @connection.get(keys[0], **opts)
|
@@ -112,6 +114,10 @@ module Libcouchbase
|
|
112
114
|
hash[keys[0]] = val
|
113
115
|
hash
|
114
116
|
})
|
117
|
+
elsif was_array
|
118
|
+
promise = promise.then(proc { |val|
|
119
|
+
Array(val)
|
120
|
+
})
|
115
121
|
end
|
116
122
|
|
117
123
|
result(promise, async)
|
@@ -134,8 +140,9 @@ module Libcouchbase
|
|
134
140
|
|
135
141
|
result(@reactor.all(*promises).then(proc { |results|
|
136
142
|
if not extended
|
137
|
-
# Check if resp nil as might have been a quiet request
|
138
143
|
results.collect! { |resp| resp.value if resp }
|
144
|
+
else
|
145
|
+
results.compact!
|
139
146
|
end
|
140
147
|
|
141
148
|
if assemble_hash
|
data/lib/libcouchbase/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libcouchbase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen von Takach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|