spotlight-dor-resources 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +6 -7
- data/app/models/spotlight/resources/dor_harvester.rb +1 -3
- data/lib/spotlight/dor/resources/version.rb +1 -1
- data/spec/integration/gdor_integration_spec.rb +2 -5
- data/spec/models/spotlight/resources/dor_harvester_spec.rb +14 -2
- data/spotlight-dor-resources.gemspec +2 -2
- metadata +6 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6454dc1dc2ecd62b6742f158f49c5d3c0463f13
|
4
|
+
data.tar.gz: fa13810076a206a0869e41cc8ab833f652833119
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6f4acd16f57c69655e415a4e0d383e079593f9dc39ec867ebe264ebfac17b1b76b8084443a0e94fbe6e4f657512eed3bfcd0d9b560ee959d9c8c976381fd7a9
|
7
|
+
data.tar.gz: 5a0835148edb693100764d467fb9dcece618e5eeed95f30c35273649a5fb42c78ab42eb07d3b85606d4e6030776a4d8f5c1deaaf461c499cbf15a5c59364a468
|
data/.rubocop_todo.yml
CHANGED
@@ -11,15 +11,14 @@ Lint/UselessAccessModifier:
|
|
11
11
|
Exclude:
|
12
12
|
- 'lib/spotlight/dor/indexer.rb'
|
13
13
|
|
14
|
-
# Offense count:
|
15
|
-
|
16
|
-
RSpec/ExampleLength:
|
14
|
+
# Offense count: 1
|
15
|
+
RSpec/AnyInstance:
|
17
16
|
Exclude:
|
18
|
-
- 'spec/lib/spotlight/dor/indexer_spec.rb'
|
19
17
|
- 'spec/models/spotlight/resources/dor_harvester_spec.rb'
|
20
18
|
|
21
|
-
# Offense count:
|
22
|
-
|
19
|
+
# Offense count: 6
|
20
|
+
# Configuration parameters: Max.
|
21
|
+
RSpec/ExampleLength:
|
23
22
|
Exclude:
|
24
|
-
- 'spec/
|
23
|
+
- 'spec/lib/spotlight/dor/indexer_spec.rb'
|
25
24
|
- 'spec/models/spotlight/resources/dor_harvester_spec.rb'
|
@@ -12,9 +12,7 @@ module Spotlight::Resources
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def resources
|
15
|
-
@resources ||= druids.map
|
16
|
-
Spotlight::Dor::Resources.indexer.resource d
|
17
|
-
end
|
15
|
+
@resources ||= druids.map { |d| Spotlight::Dor::Resources.indexer.resource(d) }.select(&:exists?)
|
18
16
|
end
|
19
17
|
|
20
18
|
def druids
|
@@ -1,12 +1,9 @@
|
|
1
1
|
describe 'gdor indexing integration test', :vcr do
|
2
|
-
let :exhibit
|
3
|
-
double(solr_data: {}, blacklight_config: Blacklight::Configuration.new)
|
4
|
-
end
|
2
|
+
let(:exhibit) { FactoryGirl.create(:exhibit) }
|
5
3
|
|
6
4
|
subject do
|
7
|
-
r = Spotlight::Resources::DorHarvester.new(druid_list: 'xf680rd3068')
|
5
|
+
r = Spotlight::Resources::DorHarvester.new(druid_list: 'xf680rd3068', exhibit: exhibit)
|
8
6
|
allow(r).to receive(:to_global_id).and_return('x')
|
9
|
-
allow(r).to receive(:exhibit).and_return(exhibit)
|
10
7
|
r.document_builder.to_solr.first
|
11
8
|
end
|
12
9
|
|
@@ -7,7 +7,7 @@ describe Spotlight::Resources::DorHarvester do
|
|
7
7
|
double
|
8
8
|
end
|
9
9
|
|
10
|
-
subject { described_class.new druid_list: 'xf680rd3068' }
|
10
|
+
subject { described_class.new druid_list: 'xf680rd3068', exhibit: exhibit }
|
11
11
|
let(:resource) { subject.resources.first }
|
12
12
|
|
13
13
|
before do
|
@@ -61,13 +61,25 @@ describe Spotlight::Resources::DorHarvester do
|
|
61
61
|
it 'has the correct indexer' do
|
62
62
|
expect(resource.indexer).to eq Spotlight::Dor::Resources.indexer.harvestdor
|
63
63
|
end
|
64
|
+
|
65
|
+
context 'with an unpublished druid' do
|
66
|
+
let(:missing_resource) { instance_double(Harvestdor::Indexer::Resource, exists?: false) }
|
67
|
+
|
68
|
+
before do
|
69
|
+
allow(Spotlight::Dor::Resources.indexer).to receive(:resource).with('xf680rd3068').and_return(missing_resource)
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'excludes missing resources' do
|
73
|
+
expect(subject.resources).to be_empty
|
74
|
+
end
|
75
|
+
end
|
64
76
|
end
|
65
77
|
|
66
78
|
describe '#reindex' do
|
67
79
|
before do
|
68
80
|
allow(Spotlight::Dor::Resources.indexer).to receive(:solr_document).and_return(upstream: true)
|
69
81
|
allow(resource).to receive(:collection?).and_return(false)
|
70
|
-
|
82
|
+
allow_any_instance_of(SolrDocument).to receive(:to_solr).and_return({})
|
71
83
|
end
|
72
84
|
|
73
85
|
it 'adds a document to solr' do
|
@@ -24,9 +24,9 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency 'solrizer'
|
25
25
|
spec.add_dependency 'gdor-indexer', '>=0.5.0' # for new pub date methods
|
26
26
|
# newer versions of harvestdor-indexer have performance improvements for collections
|
27
|
-
spec.add_dependency 'harvestdor-indexer', '~> 2.
|
27
|
+
spec.add_dependency 'harvestdor-indexer', '~> 2.4'
|
28
28
|
spec.add_dependency 'rails'
|
29
|
-
spec.add_dependency 'blacklight-spotlight', '~> 0.
|
29
|
+
spec.add_dependency 'blacklight-spotlight', '~> 0.20'
|
30
30
|
spec.add_dependency 'parallel'
|
31
31
|
spec.add_dependency 'stanford-mods', '~> 2.1'
|
32
32
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
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: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -58,20 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '2.
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 2.3.2
|
61
|
+
version: '2.4'
|
65
62
|
type: :runtime
|
66
63
|
prerelease: false
|
67
64
|
version_requirements: !ruby/object:Gem::Requirement
|
68
65
|
requirements:
|
69
66
|
- - "~>"
|
70
67
|
- !ruby/object:Gem::Version
|
71
|
-
version: '2.
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 2.3.2
|
68
|
+
version: '2.4'
|
75
69
|
- !ruby/object:Gem::Dependency
|
76
70
|
name: rails
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,14 +86,14 @@ dependencies:
|
|
92
86
|
requirements:
|
93
87
|
- - "~>"
|
94
88
|
- !ruby/object:Gem::Version
|
95
|
-
version: '0.
|
89
|
+
version: '0.20'
|
96
90
|
type: :runtime
|
97
91
|
prerelease: false
|
98
92
|
version_requirements: !ruby/object:Gem::Requirement
|
99
93
|
requirements:
|
100
94
|
- - "~>"
|
101
95
|
- !ruby/object:Gem::Version
|
102
|
-
version: '0.
|
96
|
+
version: '0.20'
|
103
97
|
- !ruby/object:Gem::Dependency
|
104
98
|
name: parallel
|
105
99
|
requirement: !ruby/object:Gem::Requirement
|