spotlight-dor-resources 0.2.2 → 0.2.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51c2413bf267fceeaae2eb498ad5c81b44c40877
|
4
|
+
data.tar.gz: f4f60e931737ebc840ad61f7b7fb1d272dd106b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7d71a1624eaad421bd9784b35db016cfa972df641aabe2be42c780b611a5dc35b90d5777e42337a935bd9c397d79a9cf5ed46aa6e1fd4545cbd3d3e1f3fbb9b
|
7
|
+
data.tar.gz: b68375cd5b0793f4f035ce79007175468e9368c373001a968940a366982f5dcb71888f14f27720ba65b1467d894d889e290c93e822c394d0ceaf29df1359b85f
|
@@ -15,7 +15,8 @@ module Spotlight::Resources
|
|
15
15
|
|
16
16
|
indexable_resources.each_with_index do |res, idx|
|
17
17
|
benchmark "Indexing item #{res.druid} in resource #{id} (#{idx} / #{size})" do
|
18
|
-
|
18
|
+
doc = to_solr_document(res)
|
19
|
+
yield base_doc.merge(doc) if doc
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
@@ -55,6 +56,9 @@ module Spotlight::Resources
|
|
55
56
|
# @return [Hash]
|
56
57
|
def to_solr_document(resource)
|
57
58
|
Spotlight::Dor::Resources.indexer.solr_document(resource)
|
59
|
+
rescue RuntimeError => e
|
60
|
+
logger.error("Error processing #{resource.druid}: #{e}")
|
61
|
+
nil
|
58
62
|
end
|
59
63
|
|
60
64
|
##
|
@@ -101,6 +101,12 @@ describe Spotlight::Resources::Purl do
|
|
101
101
|
expect(solr_doc.first).to include :collection
|
102
102
|
expect(solr_doc.last).to include :item
|
103
103
|
end
|
104
|
+
|
105
|
+
it 'traps indexing errors' do
|
106
|
+
allow(subject.resource).to receive(:items).and_return([])
|
107
|
+
expect(Spotlight::Dor::Resources.indexer).to receive(:solr_document).and_raise(RuntimeError.new)
|
108
|
+
expect { subject.to_solr.to_a }.not_to raise_error
|
109
|
+
end
|
104
110
|
end
|
105
111
|
|
106
112
|
context 'with a single item' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spotlight-dor-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|