couch-db 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/couch.rb +10 -20
- data/lib/couch/db/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adb22712bf4bea4e5380141e86315d4de7d2ce8f
|
4
|
+
data.tar.gz: a7cc0e906777dd05afbe54b4da9584d5101c4d4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c442d51f3f9416a73811184e2a1d435f00f4e0b8ac62d3df9de602b535a8e0a475bfe6ebdf9091dc1609c50dda78b635669f4243e72e37c22eb3d29c3e16d11c
|
7
|
+
data.tar.gz: f0dc46cab01abfe0d5205bffcea24292d89ee4ec7b88a489d04d599aa526f1ec09892ad2e7e9b3c72301ab820c8223679c35c2a865c2ea4dcab1c093c5b532cc
|
data/lib/couch.rb
CHANGED
@@ -63,13 +63,13 @@ module Couch
|
|
63
63
|
#
|
64
64
|
# Note that the 'include_docs' parameter must be set to true for this.
|
65
65
|
def get_all_docs(database, params)
|
66
|
-
unless params.include_symbol_or_string? :include_docs
|
67
|
-
|
68
|
-
end
|
66
|
+
# unless params.include_symbol_or_string? :include_docs
|
67
|
+
# params.merge!({:include_docs => true})
|
68
|
+
# end
|
69
69
|
postfix = create_postfix(params)
|
70
70
|
uri = URI::encode "/#{database}/_all_docs#{postfix}"
|
71
71
|
res = get(uri)
|
72
|
-
|
72
|
+
JSON.parse(res.body)['rows']
|
73
73
|
end
|
74
74
|
|
75
75
|
|
@@ -204,17 +204,6 @@ module Couch
|
|
204
204
|
all.flatten
|
205
205
|
end
|
206
206
|
|
207
|
-
def append_docs(result)
|
208
|
-
docs = []
|
209
|
-
result['rows'].each do |row|
|
210
|
-
if row['error'] or !row['doc']
|
211
|
-
puts "Found row with error:\n#{row['key']}: #{row['error']}\n#{row['reason']}"
|
212
|
-
else
|
213
|
-
docs << row['doc']
|
214
|
-
end
|
215
|
-
end
|
216
|
-
docs
|
217
|
-
end
|
218
207
|
end
|
219
208
|
|
220
209
|
module Delete
|
@@ -283,13 +272,14 @@ module Couch
|
|
283
272
|
|
284
273
|
class Server
|
285
274
|
attr_accessor :options
|
286
|
-
|
275
|
+
|
287
276
|
def initialize(url, options)
|
288
277
|
if url.is_a? String
|
289
278
|
url = URI(url)
|
290
279
|
end
|
291
280
|
@couch_url = url
|
292
281
|
@options = options
|
282
|
+
@options[:couch_url] = @couch_url
|
293
283
|
@options[:use_ssl] ||= true
|
294
284
|
@options[:max_array_length] ||= 250
|
295
285
|
@options[:flush_size_mb] ||= 10
|
@@ -298,9 +288,9 @@ module Couch
|
|
298
288
|
@options[:fail_silent] ||= false
|
299
289
|
end
|
300
290
|
|
301
|
-
def delete(uri
|
291
|
+
def delete(uri)
|
302
292
|
Request.new(Net::HTTP::Delete.new(uri), nil,
|
303
|
-
@options
|
293
|
+
@options
|
304
294
|
).perform
|
305
295
|
end
|
306
296
|
|
@@ -308,9 +298,9 @@ module Couch
|
|
308
298
|
Request.new(Net::HTTP::Delete.new(uri)).couch_url(@couch_url)
|
309
299
|
end
|
310
300
|
|
311
|
-
def head(uri
|
301
|
+
def head(uri)
|
312
302
|
Request.new(Net::HTTP::Head.new(uri), nil,
|
313
|
-
@options
|
303
|
+
@options
|
314
304
|
).perform
|
315
305
|
end
|
316
306
|
|
data/lib/couch/db/version.rb
CHANGED