stanford-mods 1.1.3 → 1.1.4

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: 9722c214d739a32c67490100bccdf57afb4b65ba
4
- data.tar.gz: 76b4d92135bba2f46582d8e88358bba16c4c8502
3
+ metadata.gz: 263c241c3db2224132441cf57740be7ac0c73495
4
+ data.tar.gz: 735eb6fe63c5227159a69b271ce5af61024f2f83
5
5
  SHA512:
6
- metadata.gz: 9e31936949c817eac3eba720ff0e65b5aa9ce9a423c47fc77a2e13d5782b1f7a1c65f02ee30830c2bdd0035c2aa0f1a8fb4cb0d16ccf59c42eddfec20398709c
7
- data.tar.gz: 2a47a14e8f912f9b7e8c528107d47ea0cf19ceeea10a291ae060d442ac96474da8356f047f63ff1a7c00e3d52996dffadc434071e7e91102fbfbbee5ec17fd81
6
+ metadata.gz: 38de7ce352621e92605efb02bbccf6c79200779e7648a766e72592eb334236cead01a7470dcc2cd7e3846ba5fc5a299f8a5c836977784b4a87eaf638ae4beb28
7
+ data.tar.gz: b2380744c02745e5a545350a39fa904cbc531367018f1b2054d3346dd17053c928be1cc9382ac5e1f1a234f01e115b6aac02f7e221d1fc3a59188b84a2da18c9
@@ -425,8 +425,12 @@ module Stanford
425
425
  year = []
426
426
  pruned_dates = []
427
427
  dates.each do |f_date|
428
- #remove ? and []
429
- pruned_dates << f_date.gsub('?','').gsub('[','').gsub(']','')
428
+ #remove ? and []
429
+ if (f_date.length == 4 && f_date.end_with?('?'))
430
+ pruned_dates << f_date.gsub('?','0')
431
+ else
432
+ pruned_dates << f_date.gsub('?','').gsub('[','').gsub(']','')
433
+ end
430
434
  end
431
435
  #try to find a date starting with the most normal date formats and progressing to more wonky ones
432
436
  @pub_year = get_plain_four_digit_year pruned_dates
@@ -1,6 +1,6 @@
1
1
  module Stanford
2
2
  module Mods
3
3
  # this is the Ruby Gem version
4
- VERSION = "1.1.3"
4
+ VERSION = "1.1.4"
5
5
  end
6
6
  end
@@ -130,6 +130,15 @@ describe "Date methods (searchworks.rb)" do
130
130
  expect(@smods_rec.pub_date_sort).to eq('1860')
131
131
  expect(@smods_rec.pub_date_facet).to eq('1860')
132
132
  end
133
+ it 'should use the dateIssued without marc encoding for pub_date_display and the one with marc encoding for indexing, sorting and faceting' do
134
+ m = "<mods #{@ns_decl}><originInfo><dateIssued>1860?]</dateIssued><dateIssued encoding=\"marc\">186?</dateIssued><issuance>monographic</issuance></originInfo>"
135
+ @smods_rec = Stanford::Mods::Record.new
136
+ @smods_rec.from_str(m)
137
+ expect(@smods_rec.pub_date_display).to eq('1860?]')
138
+ expect(@smods_rec.pub_date).to eq('1860')
139
+ expect(@smods_rec.pub_date_sort).to eq('1860')
140
+ expect(@smods_rec.pub_date_facet).to eq('1860')
141
+ end
133
142
  end # pub_date
134
143
 
135
144
  context "dates with u notation (198u, 19uu)" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stanford-mods
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-13 00:00:00.000000000 Z
12
+ date: 2015-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mods