spotlight-dor-resources 1.0.0 → 1.0.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
  SHA1:
3
- metadata.gz: c1c36106b2008109449362c180ae930b0c2ed8fb
4
- data.tar.gz: b53aa8267ae171222b5bed3c5f2569a936196b22
3
+ metadata.gz: 26c9986fe02749baef5e222fbd5307aaed238473
4
+ data.tar.gz: 211ec782a3c90f62010857c8d5467c7d091d470d
5
5
  SHA512:
6
- metadata.gz: 1aaf989efd1f2bf22a6cf916e0a3e2132ae3460222a2f7b5484bd582a9129c049da46dfb33ad2dc678e3ac3710ad2c79abeffe78c80ef43f4a31e0935f96b014
7
- data.tar.gz: d3a97d019c8efcfcf23993fccf2293e0bf375e32b22d6402ac306d1562709fd7b0d790943d0a03ad5d8eee7d0f88721a3286a2472249c9db5d7fefecc34ac431
6
+ metadata.gz: 59b9799e167ce1e845a32700a305f33677d65c4795690da1fc97cc3a6be4eb2e5d7e257b3fbf88598a5a2f8e4521b7a51856d9a39a03caf61cbe9cf7d0f2c64c
7
+ data.tar.gz: d6bc026eae7dffe3b4c7e3579028b5c0140a3cf4e3afd78a730515502327fcf5f298c1b5b12445661126b52782d0fd878f1a2a1abc76a8978d3ce379d6fc15e2
@@ -152,7 +152,7 @@ module Spotlight::Dor
152
152
 
153
153
  def add_donor_tags(sdb, solr_doc)
154
154
  donor_tags = sdb.smods_rec.note.select { |n| n.displayLabel == 'Donor tags' }.map(&:content)
155
- insert_field solr_doc, 'donor_tags', donor_tags, :symbol # this is a _ssim field
155
+ insert_field solr_doc, 'donor_tags', upcase_first_character(donor_tags), :symbol # this is a _ssim field
156
156
  end
157
157
 
158
158
  # add the folder name to solr_doc as folder_name_ssi field (note: single valued!)
@@ -213,6 +213,12 @@ module Spotlight::Dor
213
213
  end
214
214
  end
215
215
 
216
+ # takes an array, upcases just the first character of each element in the array and returns the new array
217
+ # not the same as .captialize which will lowercase the rest of the string
218
+ def upcase_first_character(values)
219
+ values.map { |value| value.sub(/^./, &:upcase) }
220
+ end
221
+
216
222
  def insert_field(solr_doc, field, values, *args)
217
223
  Array(values).each do |v|
218
224
  Solrizer.insert_field solr_doc, field, v, *args
@@ -2,7 +2,7 @@ module Spotlight
2
2
  module Dor
3
3
  # :nodoc:
4
4
  module Resources
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
  end
7
7
  end
8
8
  end
@@ -141,6 +141,7 @@ describe Spotlight::Dor::Indexer do
141
141
  <mods xmlns="#{Mods::MODS_NS}">
142
142
  <note displayLabel="Donor tags">Knowledge Systems Laboratory</note>
143
143
  <note displayLabel="Donor tags">medical applications</note>
144
+ <note displayLabel="Donor tags">medical Applications (second word CAPPED)</note>
144
145
  <note displayLabel="Donor tags">Publishing</note>
145
146
  <note displayLabel="Donor tags">Stanford</note>
146
147
  <note displayLabel="Donor tags">Stanford Computer Science Department</note>
@@ -150,7 +151,8 @@ describe Spotlight::Dor::Indexer do
150
151
 
151
152
  it 'extracts the donor tags' do
152
153
  expect(solr_doc['donor_tags_ssim']).to contain_exactly 'Knowledge Systems Laboratory',
153
- 'medical applications',
154
+ 'Medical applications',
155
+ 'Medical Applications (second word CAPPED)',
154
156
  'Publishing',
155
157
  'Stanford',
156
158
  'Stanford Computer Science Department'
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: 1.0.0
4
+ version: 1.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-02-19 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday