cul_scv_hydra 0.22.8 → 0.22.9

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: 1a9bdfdcfcd9c0166e9c60bebf41c051f4e5673c
4
- data.tar.gz: 7b6f4090d51a484def9bc6700f8bdde0a7433593
3
+ metadata.gz: a3bfdbde8c8ab4486d3b85fa6db992a5c28f88de
4
+ data.tar.gz: 7ac54765be9032aa1ee8bf82f026fe609ef90812
5
5
  SHA512:
6
- metadata.gz: fbc7b110d30b0a2ec1111e0c587e20bfa39aaf560503e86d8caa8fddea91649c61362ac501290ff09d3c7e9eaa3c3828891640dff701e9522ab119a5d6da4722
7
- data.tar.gz: 198d4a6f45211f98a944bd42383d5832a5d3de4dcbddc4ae423fec27f390a5389d799d9ce821701a1224f1101774a1d66e256faf044e57619c73a80af066bd99
6
+ metadata.gz: 79d947da95140479bae797c5ac45904acb83e8b141798a10116ebb208eb0e079bf13a329d4367926ade338f162de8e1cfc74e7fd47d4a9e3867036d3e08b299d
7
+ data.tar.gz: 455bcd3ba5a7dd253a6e286ec690c4726cd26eb19b054af8f488629a8552d96b79160531085f48101043f5ad8acd4c53189ce62d182f4b2b525977f48533af19
@@ -0,0 +1,7 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+ <mods xmlns='http://www.loc.gov/mods/v3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd' version='3.4'>
3
+ <originInfo>
4
+ <dateOther encoding='w3cdtf' keyDate='yes' point='start'>1870</dateOther>
5
+ <dateOther encoding='w3cdtf' point='end'>uuuu</dateOther>
6
+ </originInfo>
7
+ </mods>
@@ -0,0 +1,7 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+ <mods xmlns='http://www.loc.gov/mods/v3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd' version='3.4'>
3
+ <originInfo>
4
+ <dateOther encoding='w3cdtf' keyDate='yes' point='start'>uuuu</dateOther>
5
+ <dateOther encoding='w3cdtf' point='end'>1920</dateOther>
6
+ </originInfo>
7
+ </mods>
@@ -0,0 +1,7 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+ <mods xmlns='http://www.loc.gov/mods/v3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd' version='3.4'>
3
+ <originInfo>
4
+ <dateOther encoding='w3cdtf' keyDate='yes' point='start'>uuuu</dateOther>
5
+ <dateOther encoding='w3cdtf' point='end'>uuuu</dateOther>
6
+ </originInfo>
7
+ </mods>
@@ -0,0 +1,7 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+ <mods xmlns='http://www.loc.gov/mods/v3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd' version='3.4'>
3
+ <originInfo>
4
+ <dateOther encoding='w3cdtf' keyDate='yes' point='start'>187u</dateOther>
5
+ <dateOther encoding='w3cdtf' point='end'>19uu</dateOther>
6
+ </originInfo>
7
+ </mods>
@@ -392,25 +392,38 @@ module Cul::Hydra::Solrizer
392
392
 
393
393
  if start_date.present?
394
394
 
395
- end_date = start_date if end_date.blank?
395
+ start_year = nil
396
+ end_year = nil
396
397
 
397
- year_regex = /^(-?\d{1,4}).*/
398
+ start_date = nil if start_date == 'uuuu'
399
+ end_date = nil if end_date == 'uuuu'
400
+ start_date = start_date.gsub('u', '0') unless start_date.nil?
401
+ end_date = end_date.gsub('u', '0') unless end_date.nil?
398
402
 
399
- start_year_match = start_date.match(year_regex)
400
- if start_year_match && start_year_match.captures.length > 0
401
- start_year = start_year_match.captures[0]
402
- start_year = zero_pad_year(start_year)
403
- solr_doc["lib_start_date_year_itsi"] = start_year.to_i # TrieInt version for searches
404
- end
403
+ end_date = start_date if end_date.blank?
404
+ start_date = end_date if start_date.blank?
405
405
 
406
- end_year_match = end_date.match(year_regex)
407
- if end_year_match && end_year_match.captures.length > 0
408
- end_year = end_year_match.captures[0]
409
- end_year = zero_pad_year(end_year)
410
- solr_doc["lib_end_date_year_itsi"] = end_year.to_i # TrieInt version for searches
411
- end
406
+ year_regex = /^(-?\d{1,4}).*/
412
407
 
413
- solr_doc["lib_date_year_range_si"] = start_year + '-' + end_year if start_year
408
+ unless start_date.blank?
409
+ start_year_match = start_date.match(year_regex)
410
+ if start_year_match && start_year_match.captures.length > 0
411
+ start_year = start_year_match.captures[0]
412
+ start_year = zero_pad_year(start_year)
413
+ solr_doc["lib_start_date_year_itsi"] = start_year.to_i # TrieInt version for searches
414
+ end
415
+ end
416
+
417
+ unless end_date.blank?
418
+ end_year_match = end_date.match(year_regex)
419
+ if end_year_match && end_year_match.captures.length > 0
420
+ end_year = end_year_match.captures[0]
421
+ end_year = zero_pad_year(end_year)
422
+ solr_doc["lib_end_date_year_itsi"] = end_year.to_i # TrieInt version for searches
423
+ end
424
+ end
425
+
426
+ solr_doc["lib_date_year_range_si"] = start_year + '-' + end_year if start_year && end_year
414
427
 
415
428
  # When no textual date is available, fall back to other date data (if available)
416
429
  if solr_doc["lib_date_textual_ssm"].blank?
@@ -1,6 +1,6 @@
1
1
  module Cul
2
2
  module Hydra
3
- VERSION = '0.22.8'
3
+ VERSION = '0.22.9'
4
4
  def self.version
5
5
  VERSION
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Cul
2
2
  module Hydra
3
- VERSION = '0.22.7'
3
+ VERSION = '0.22.8'
4
4
  def self.version
5
5
  VERSION
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cul_scv_hydra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.8
4
+ version: 0.22.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Armintor
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-04 00:00:00.000000000 Z
12
+ date: 2015-03-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight
@@ -393,11 +393,15 @@ files:
393
393
  - fixtures/spec/CUL_MODS/mods-bad-repo.xml
394
394
  - fixtures/spec/CUL_MODS/mods-date-created-range.xml
395
395
  - fixtures/spec/CUL_MODS/mods-date-created-single.xml
396
+ - fixtures/spec/CUL_MODS/mods-date-end-with-all-u-characters.xml
396
397
  - fixtures/spec/CUL_MODS/mods-date-issued-range.xml
397
398
  - fixtures/spec/CUL_MODS/mods-date-issued-single.xml
398
399
  - fixtures/spec/CUL_MODS/mods-date-other-range.xml
399
400
  - fixtures/spec/CUL_MODS/mods-date-other-single.xml
400
401
  - fixtures/spec/CUL_MODS/mods-date-range-short-years.xml
402
+ - fixtures/spec/CUL_MODS/mods-date-start-with-all-u-characters.xml
403
+ - fixtures/spec/CUL_MODS/mods-dates-with-all-u-characters.xml
404
+ - fixtures/spec/CUL_MODS/mods-dates-with-some-u-characters.xml
401
405
  - fixtures/spec/CUL_MODS/mods-item.xml
402
406
  - fixtures/spec/CUL_MODS/mods-names.xml
403
407
  - fixtures/spec/CUL_MODS/mods-notes.xml