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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/couch.rb +10 -20
  3. data/lib/couch/db/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e92baa55e77c565b84459f4750ab0cd45f0752e5
4
- data.tar.gz: e951689a319ce402fe6aa741d397e7bf5b00249d
3
+ metadata.gz: adb22712bf4bea4e5380141e86315d4de7d2ce8f
4
+ data.tar.gz: a7cc0e906777dd05afbe54b4da9584d5101c4d4e
5
5
  SHA512:
6
- metadata.gz: 801b3abbf35221122df1d5b2e22420452a7d77036a7134907f6ac7c625e687902ea4c478aee9421ab9627224efe51db90f8b179aa01381a2c8a5ac8b874720c2
7
- data.tar.gz: 1775111c62395c8a83ba68b6c9032c650375537a47bbde368376da0e3168dcf6756871ba031ad9bef2dfa7be36ff6b50e8bbb037d0b433624ed811807f172230
6
+ metadata.gz: c442d51f3f9416a73811184e2a1d435f00f4e0b8ac62d3df9de602b535a8e0a475bfe6ebdf9091dc1609c50dda78b635669f4243e72e37c22eb3d29c3e16d11c
7
+ data.tar.gz: f0dc46cab01abfe0d5205bffcea24292d89ee4ec7b88a489d04d599aa526f1ec09892ad2e7e9b3c72301ab820c8223679c35c2a865c2ea4dcab1c093c5b532cc
@@ -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
- params.merge!({:include_docs => true})
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
- append_docs(JSON.parse(res.body))
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, open_timeout: 5*30, read_timeout: 5*30, fail_silent: false)
291
+ def delete(uri)
302
292
  Request.new(Net::HTTP::Delete.new(uri), nil,
303
- @options.merge({couch_url: @couch_url, open_timeout: open_timeout, read_timeout: read_timeout, fail_silent: fail_silent})
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, open_timeout: 5*30, read_timeout: 5*30, fail_silent: true)
301
+ def head(uri)
312
302
  Request.new(Net::HTTP::Head.new(uri), nil,
313
- @options.merge({couch_url: @couch_url, open_timeout: open_timeout, read_timeout: read_timeout, fail_silent: fail_silent})
303
+ @options
314
304
  ).perform
315
305
  end
316
306
 
@@ -1,6 +1,6 @@
1
1
  module Couch
2
2
  # noinspection ALL
3
3
  module DB
4
- VERSION = '0.10.0'
4
+ VERSION = '0.11.0'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couch-db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten Trompper