harvestdor-indexer 2.3.3 → 2.4.0

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
  SHA1:
3
- metadata.gz: b4450922f3ca88b01fa640e422b3034573d8ffcd
4
- data.tar.gz: 982f4537396650e5df6b180335bd8243dc7d8212
3
+ metadata.gz: 2615efed3ea7e94441d7457e39cd5bc3503a5cd9
4
+ data.tar.gz: 508ff570b19083f8f78ea29d3f820c09f698f392
5
5
  SHA512:
6
- metadata.gz: f82640a960c1274a685c65499f49f8e1b432fb8f95bc2e7a5d45f83bae007c8dba3c92c03c33d4a1311399657f83c012e3c08499c45d1f44bce93c726ee8f528
7
- data.tar.gz: 17b1176e6de1ccdaae08b09fb8190615bfc4c7e6768ed5762b25fee7abdc77cdeb4ad41d73125bc6ef1e02bd648f70be071b12dff8e94de4eb07044d1302065b
6
+ metadata.gz: 8960f3c459bd794532ddc94e0d80d31f5f85692f9e08eca0a540054290054dfeee9082c2bc68f9d3ee5e5e516be03b43fdebe8a2fba9834c47a8e21dfc2ea65a
7
+ data.tar.gz: 10cf83435837099f544094927182de39a2ae624e66cdff7f0477158de923d22cd27c174d5f1d8127ead92df9f4162a3f3fc50a03bc98e7ce68eb59e94393b804
@@ -16,7 +16,13 @@ Lint/UselessAssignment:
16
16
  Metrics/AbcSize:
17
17
  Max: 20
18
18
 
19
- # Offense count: 107
19
+ # Offense count: 1
20
+ # Configuration parameters: CountComments.
21
+ Metrics/ClassLength:
22
+ Exclude:
23
+ - 'lib/harvestdor/indexer/resource.rb'
24
+
25
+ # Offense count: 92
20
26
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
21
27
  # URISchemes: http, https
22
28
  Metrics/LineLength:
@@ -3,9 +3,8 @@ sudo: false
3
3
  script: rake
4
4
  rvm:
5
5
  - 2.2.3
6
-
6
+
7
7
  notifications:
8
8
  email:
9
- - ndushay@stanford.edu
10
9
  - laneymcg@stanford.edu
11
10
  - cabeer@stanford.edu
@@ -35,6 +35,12 @@ module Harvestdor
35
35
  options[:logger] || (indexer.logger if indexer.respond_to? :logger) || Logger.new(STDERR)
36
36
  end
37
37
 
38
+ def exists?
39
+ public_xml
40
+ rescue Harvestdor::Errors::MissingPublicXml, Harvestdor::Errors::MissingPurlPage
41
+ false
42
+ end
43
+
38
44
  ##
39
45
  # Is this resource a collection?
40
46
  def collection?
@@ -1,6 +1,6 @@
1
1
  module Harvestdor
2
2
  class Indexer
3
3
  # this is the Ruby Gem version
4
- VERSION = '2.3.3'.freeze
4
+ VERSION = '2.4.0'.freeze
5
5
  end
6
6
  end
@@ -23,6 +23,23 @@ describe Harvestdor::Indexer::Resource do
23
23
 
24
24
  subject { resource }
25
25
 
26
+ describe '#exists?' do
27
+ it 'exists if the public xml is present and available' do
28
+ allow(subject).to receive(:public_xml).and_return(blank_public_xml)
29
+ expect(subject).to exist
30
+ end
31
+
32
+ it 'does not exist if the public xml is empty' do
33
+ allow(subject).to receive(:public_xml).and_raise Harvestdor::Errors::MissingPurlPage
34
+ expect(subject).not_to exist
35
+ end
36
+
37
+ it 'does not exist if the purl is missing' do
38
+ allow(subject).to receive(:public_xml).and_raise Harvestdor::Errors::MissingPurlPage
39
+ expect(subject).not_to exist
40
+ end
41
+ end
42
+
26
43
  describe '#items' do
27
44
  context 'for a regular item' do
28
45
  before do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harvestdor-indexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.3
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-07-26 00:00:00.000000000 Z
13
+ date: 2016-07-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr