couch_potato 1.10.0 → 1.10.1

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
  SHA256:
3
- metadata.gz: 699af51806a63fca2975c8eff17636647a5ca7c12f9131df7e30a5f843ab3028
4
- data.tar.gz: 1e305be23ca0606bef97e7f89b06f166f694a7ec937a2641c782274dc9a8cf51
3
+ metadata.gz: 7e0a3143ad59fbb9f3391e381841412de37afda869b90c3b105b3efe41859fa2
4
+ data.tar.gz: 452e6d3cc546b0d45feb5ea94ea81779400adf6474e22580e6637d15f58858bb
5
5
  SHA512:
6
- metadata.gz: bee39cf067a428f14b646948dc0ceea5e5b0bfde2f0eafd9e1ea025dbd5833bcfc8c328f8457aaa4ecb72aabf07a2e327f329296d1224dafb8c7967cf37d1eeb
7
- data.tar.gz: 4f371624eb17e5d03fb25a13ae9375705f1b143fccb30c8e7cbfdeaeb98d8549b7cc29f9b7a7fe83ec0ac06abef1200670ea092aebd5e46bb7aa94265ee48191
6
+ metadata.gz: f517b4ecfaf2c57eceade400298c68ef2d189f1274709c95f7bd54d97721b9131b79430956e5c517cd2fbd3781149ff9fe54c4640eaea8e82b940e97c696fd04
7
+ data.tar.gz: a668623b7cd70ab1acb86aff299f8729f8645625b560f3b45247447117c9ac69d5aa335d57ff9dacaa980cd021d2f01f5e21c0a88f5faa45d5add8045e016e21
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [2.6, 2.7, "jruby"]
19
+ ruby: [2.7, '3.0', "jruby"]
20
20
  gemfile:
21
21
  - "active_support_5_0"
22
22
  - "active_support_5_1"
@@ -25,10 +25,16 @@ jobs:
25
25
  - "active_support_6_1"
26
26
  - "active_support_7_0"
27
27
  exclude:
28
- - ruby: 2.6
29
- gemfile: "active_support_7_0"
30
28
  - ruby: "jruby"
31
29
  gemfile: "active_support_7_0"
30
+ - ruby: "3.0"
31
+ gemfile: "active_support_5_0"
32
+ - ruby: "3.0"
33
+ gemfile: "active_support_5_1"
34
+ - ruby: "3.0"
35
+ gemfile: "active_support_5_2"
36
+ - ruby: "3.0"
37
+ gemfile: "active_support_6_0"
32
38
  steps:
33
39
  - uses: actions/checkout@v2
34
40
  - name: Set up CouchDB
data/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Changes
2
2
 
3
+ ### 1.10.1
4
+
5
+ - support passing an empty array to CouchPotato::Database#load
6
+
3
7
  ### 1.10.0
4
8
 
5
9
  - add spec/support for Rails 7
data/couch_potato.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.add_dependency 'json', '~> 2.3'
19
19
 
20
20
  s.add_development_dependency 'rake', '~>12.0'
21
- s.add_development_dependency 'rspec', '~>3.5.0'
21
+ s.add_development_dependency 'rspec', '~>3.10.0'
22
22
  s.add_development_dependency 'timecop'
23
23
  s.add_development_dependency 'tzinfo'
24
24
 
@@ -269,6 +269,8 @@ module CouchPotato
269
269
  end
270
270
 
271
271
  def bulk_load(ids)
272
+ return [] if ids.empty?
273
+
272
274
  response = couchrest_database.bulk_load ids
273
275
  docs = response['rows'].map { |row| row['doc'] }.compact
274
276
  docs.each do |doc|
@@ -1,4 +1,4 @@
1
1
  module CouchPotato
2
- VERSION = '1.10.0'.freeze
2
+ VERSION = '1.10.1'.freeze
3
3
  RSPEC_VERSION = '4.0.2'.freeze
4
4
  end
data/spec/railtie_spec.rb CHANGED
@@ -87,7 +87,7 @@ describe "railtie" do
87
87
  it 'assigns additional_databases to config' do
88
88
  allow(File).to receive_messages(:read => "test:\n database: test\n additional_databases:\n db2: test2")
89
89
 
90
- expect(CouchPotato::Config).to receive(:additional_databases=).with('db2' => 'test2')
90
+ expect(CouchPotato::Config).to receive(:additional_databases=).with({'db2' => 'test2'})
91
91
 
92
92
  CouchPotato.rails_init
93
93
  end
@@ -98,6 +98,10 @@ describe CouchPotato::Database, 'load' do
98
98
 
99
99
  db.load(['1'])
100
100
  end
101
+
102
+ it 'returns an empty array when passing an empty array' do
103
+ expect(db.load([])).to eq([])
104
+ end
101
105
  end
102
106
  end
103
107
 
@@ -444,9 +448,9 @@ describe CouchPotato::Database, '#view_in_batches' do
444
448
  allow(spec).to receive(:view_parameters) { { key: 'x' } }
445
449
 
446
450
  expect(spec).to receive(:view_parameters=)
447
- .with(key: 'x', skip: 0, limit: 2)
451
+ .with({key: 'x', skip: 0, limit: 2})
448
452
  expect(spec).to receive(:view_parameters=)
449
- .with(key: 'x', skip: 2, limit: 2)
453
+ .with({key: 'x', skip: 2, limit: 2})
450
454
 
451
455
  db.view_in_batches(spec, batch_size: 2) { |results| }
452
456
  end
@@ -15,10 +15,12 @@ describe CouchPotato::View::ViewQuery, 'query_view!' do
15
15
 
16
16
  it 'updates a view if it does not exist' do
17
17
  expect(db).to receive(:save_doc).with(
18
- 'views' => {'view' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}, 'lib' => {'test' => '<lib_code>'}},
19
- 'lists' => {},
20
- "_id" => "_design/design",
21
- "language" => "javascript"
18
+ {
19
+ 'views' => {'view' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}, 'lib' => {'test' => '<lib_code>'}},
20
+ 'lists' => {},
21
+ "_id" => "_design/design",
22
+ "language" => "javascript"
23
+ }
22
24
  )
23
25
 
24
26
  CouchPotato::View::ViewQuery.new(db, 'design', {:view => {:map => '<map_code>', :reduce => '<reduce_code>'}}, nil, {'test' => "<lib_code>"}).query_view!
@@ -46,8 +48,11 @@ describe CouchPotato::View::ViewQuery, 'query_view!' do
46
48
 
47
49
  it 'updates a view in erlang if it does not exist' do
48
50
  expect(db).to receive(:save_doc).with(
49
- 'views' => {'view' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}},
50
- 'lists' => {}, "_id" => "_design/design", "language" => "erlang")
51
+ {
52
+ 'views' => {'view' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}},
53
+ 'lists' => {}, "_id" => "_design/design", "language" => "erlang"
54
+ }
55
+ )
51
56
 
52
57
  CouchPotato::View::ViewQuery.new(db, 'design',
53
58
  {:view => {:map => '<map_code>', :reduce => '<reduce_code>'}},
@@ -120,7 +125,7 @@ describe CouchPotato::View::ViewQuery, 'query_view!' do
120
125
 
121
126
  it 'does not pass in reduce or lib keys if there is no lib or reduce object' do
122
127
  allow(db).to receive(:get).and_return({'views' => {}})
123
- expect(db).to receive(:save_doc).with('views' => {'view7' => {'map' => '<map code>'}})
128
+ expect(db).to receive(:save_doc).with({'views' => {'view7' => {'map' => '<map code>'}}})
124
129
  CouchPotato::View::ViewQuery.new(db, 'design', :view7 => {:map => '<map code>', :reduce => nil}).query_view!
125
130
  end
126
131
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couch_potato
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Lang
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-28 00:00:00.000000000 Z
11
+ date: 2022-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 3.5.0
81
+ version: 3.10.0
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 3.5.0
88
+ version: 3.10.0
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: timecop
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -219,7 +219,7 @@ files:
219
219
  homepage: http://github.com/langalex/couch_potato
220
220
  licenses: []
221
221
  metadata: {}
222
- post_install_message:
222
+ post_install_message:
223
223
  rdoc_options: []
224
224
  require_paths:
225
225
  - lib
@@ -234,8 +234,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  - !ruby/object:Gem::Version
235
235
  version: '0'
236
236
  requirements: []
237
- rubygems_version: 3.1.6
238
- signing_key:
237
+ rubygems_version: 3.2.32
238
+ signing_key:
239
239
  specification_version: 4
240
240
  summary: Ruby persistence layer for CouchDB
241
241
  test_files: