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 +4 -4
- data/lib/stanford-mods/searchworks.rb +6 -2
- data/lib/stanford-mods/version.rb +1 -1
- data/spec/searchworks_pub_dates_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 263c241c3db2224132441cf57740be7ac0c73495
|
4
|
+
data.tar.gz: 735eb6fe63c5227159a69b271ce5af61024f2f83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
@@ -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.
|
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-
|
12
|
+
date: 2015-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mods
|