spotlight-dor-resources 0.6.2 → 1.0.0

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: 619ce1130073a01e872920967651aab9cf4b72d0
4
- data.tar.gz: ba03f24b3dc0e666034caaa2cfabf90a7612f28d
3
+ metadata.gz: c1c36106b2008109449362c180ae930b0c2ed8fb
4
+ data.tar.gz: b53aa8267ae171222b5bed3c5f2569a936196b22
5
5
  SHA512:
6
- metadata.gz: 5be13b1b40bd666e444ee7d818dd1081b3ca81730d0473b3d5b08d6fa050fe15070994dd52d5041630afb2e07ae726547d5d6aaeaca4214e4f1ca738ac6d75f4
7
- data.tar.gz: a310038d47f4cc598dd81208a65244010f5bd06c4c4a3d37fb5f99f0eaf5cd2f9dfe429facd4abd61ca44005714792351f313382c0e872d3e2132967c72db4bc
6
+ metadata.gz: 1aaf989efd1f2bf22a6cf916e0a3e2132ae3460222a2f7b5484bd582a9129c049da46dfb33ad2dc678e3ac3710ad2c79abeffe78c80ef43f4a31e0935f96b014
7
+ data.tar.gz: d3a97d019c8efcfcf23993fccf2293e0bf375e32b22d6402ac306d1562709fd7b0d790943d0a03ad5d8eee7d0f88721a3286a2472249c9db5d7fefecc34ac431
data/README.md CHANGED
@@ -48,20 +48,20 @@ This will download a test jetty instance (to run Solr), generate a testing app a
48
48
  ```ruby
49
49
  druid="ty202yt2402" # a feigenbaum druid
50
50
  druid="cx709ty7769" # a revs druid
51
- purl=Spotlight::Resources::Purl.new({:url=>"https://purl.stanford.edu/#{druid}"})
51
+ purl=Spotlight::Resources::DorHarvester.new(druid_list: druid)
52
52
  purl.exhibit=Spotlight::Exhibit.new # need an exhibit to attach the test solr docs too
53
53
  purl.exhibit.title='stanford'
54
54
  purl.exhibit.save
55
55
 
56
56
  puts purl.to_solr.first # the solr document as a hash
57
- public_xml=purl.resource.public_xml # nokogiri doc with all public XML
58
- mods=purl.resource.mods # nokogiri doc with just the MODs
59
- smods_rec=purl.resource.smods_rec # a Stanford::Mods::Record Object (which inherits from the MODS gem)
57
+ public_xml=purl.resources[0].public_xml # nokogiri doc with all public XML
58
+ mods=purl.resources[0].mods # nokogiri doc with just the MODs
59
+ smods_rec=purl.resources[0].smods_rec # a Stanford::Mods::Record Object (which inherits from the MODS gem)
60
60
 
61
- puts purl.resource.bare_druid # will not have the "druid:" prefix
62
- puts purl.resource.druid # might have the "druid:" prefix (if returned as the result of an is_collection call)
61
+ puts purl.resources[0].bare_druid # will not have the "druid:" prefix
62
+ puts purl.resources[0].druid # might have the "druid:" prefix (if returned as the result of an is_collection call)
63
63
 
64
- purl.resource.indexer.config.solr.url # the configured solr server (should be localhost in development)
64
+ purl.resources[0].indexer.config.solr.url # the configured solr server (should be localhost in development)
65
65
 
66
66
  purl.save # save to database and index to solr
67
67
  purl.reindex # reindex once saved the first time
@@ -71,7 +71,7 @@ module Spotlight::Dor
71
71
  end
72
72
 
73
73
  def add_location(sdb, solr_doc)
74
- solr_doc['location_ssi'] = sdb.smods_rec.location
74
+ solr_doc['location_ssi'] = sdb.smods_rec.physical_location_str
75
75
  end
76
76
 
77
77
  # add point_bbox solr field containing the point bounding box per
@@ -147,7 +147,7 @@ module Spotlight::Dor
147
147
 
148
148
  def add_document_subtype(sdb, solr_doc)
149
149
  subtype = sdb.smods_rec.note.select { |n| n.displayLabel == 'Document subtype' }.map(&:content)
150
- solr_doc['doc_subtype_ssi'] = subtype.first if subtype.size > 0
150
+ solr_doc['doc_subtype_ssi'] = subtype.first unless subtype.empty?
151
151
  end
152
152
 
153
153
  def add_donor_tags(sdb, solr_doc)
@@ -178,7 +178,7 @@ module Spotlight::Dor
178
178
  # search for configured full text files, and if found, add them to the full text (whole document) solr field
179
179
  def add_object_full_text(sdb, solr_doc)
180
180
  full_text_urls = object_level_full_text_urls(sdb)
181
- return if full_text_urls.size == 0
181
+ return if full_text_urls.empty?
182
182
  solr_doc['full_text_tesimv'] = full_text_urls.map { |file_url| get_file_content(file_url) }
183
183
  end
184
184
 
@@ -2,7 +2,7 @@ module Spotlight
2
2
  module Dor
3
3
  # :nodoc:
4
4
  module Resources
5
- VERSION = '0.6.2'
5
+ VERSION = '1.0.0'
6
6
  end
7
7
  end
8
8
  end
@@ -531,7 +531,7 @@ describe Spotlight::Dor::Indexer do
531
531
  end
532
532
 
533
533
  it 'extracts the point_bbox' do
534
- expect(solr_doc['point_bbox']).to eq(['ENVELOPE(-16.0, 28.0, -15.0, 13.0)'])
534
+ expect(solr_doc['point_bbox']).to eq(['ENVELOPE(-16.0, 28.0, 13.0, -15.0)'])
535
535
  end
536
536
  end
537
537
  end # add_point_bbox
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency 'rails'
29
29
  spec.add_dependency 'blacklight-spotlight', '~> 0.16'
30
30
  spec.add_dependency 'parallel'
31
- spec.add_dependency 'stanford-mods', '~> 1.5'
31
+ spec.add_dependency 'stanford-mods', '~> 2.1'
32
32
  spec.add_development_dependency 'bundler', '~> 1.5'
33
33
  spec.add_development_dependency 'rake'
34
34
  spec.add_development_dependency 'rspec'
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.6.2
4
+ version: 1.0.0
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-01-27 00:00:00.000000000 Z
11
+ date: 2016-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '1.5'
117
+ version: '2.1'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '1.5'
124
+ version: '2.1'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: bundler
127
127
  requirement: !ruby/object:Gem::Requirement