mods 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mods/origin_info.rb +3 -1
- data/lib/mods/version.rb +1 -1
- data/spec/origin_info_spec.rb +5 -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: 306234eaf2f846a119988b71eb34bb1cd45ad938
|
4
|
+
data.tar.gz: a9fdcb2720539181b8860e74a54bfb0616e20682
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67de885bfad88445121a98a4ea6ab576dc2c563e8848aca3d342623223e40cb93fa6db66cfde2290d0817f364bc323fa6d7576e522876407fc57c6dc44c99787
|
7
|
+
data.tar.gz: 55c51cf6b2d257c67cec056d9031c21889d23cd6c747917bd68f61039169d1ac8c3c18a5963a113dda6593c4b7db6d428b64bc74ed820ecc5159c1a5e77936de
|
data/lib/mods/origin_info.rb
CHANGED
@@ -13,7 +13,9 @@ module Mods
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def key_dates
|
16
|
-
dates.select { |x| x.keyDate == 'yes' }
|
16
|
+
d = dates.select { |x| x.keyDate == 'yes' }
|
17
|
+
|
18
|
+
d += dates.select { |x| x.point == 'end' && d.any? { |date| date.name == x.name && date.point == 'start' } }
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
data/lib/mods/version.rb
CHANGED
data/spec/origin_info_spec.rb
CHANGED
@@ -249,6 +249,11 @@ describe "Mods <originInfo> Element" do
|
|
249
249
|
@mods_rec.from_str("<mods #{@ns_decl}><originInfo><dateCreated>other date</dateCreated><dateCreated keyDate='yes'>key date</dateCreated></originInfo></mods>")
|
250
250
|
expect(@mods_rec.origin_info.as_object.first.key_dates.first.text).to eq 'key date'
|
251
251
|
end
|
252
|
+
it 'should extract a date range when the keyDate attribute is on the start of the range' do
|
253
|
+
@mods_rec.from_str("<mods #{@ns_decl}><originInfo><dateCreated point='end'>other date</dateCreated><dateCreated keyDate='yes' point='start'>key date</dateCreated></originInfo></mods>")
|
254
|
+
expect(@mods_rec.origin_info.as_object.first.key_dates.first.text).to eq 'key date'
|
255
|
+
expect(@mods_rec.origin_info.as_object.first.key_dates.last.text).to eq 'other date'
|
256
|
+
end
|
252
257
|
end
|
253
258
|
end
|
254
259
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mods
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
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: 2017-12-
|
12
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|