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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b02fccf6e03afe427a8c23d821ebb2692b635f6d
4
- data.tar.gz: d7f7fd87cd6ba14ab473dea40383f550f4cfa1e2
3
+ metadata.gz: 306234eaf2f846a119988b71eb34bb1cd45ad938
4
+ data.tar.gz: a9fdcb2720539181b8860e74a54bfb0616e20682
5
5
  SHA512:
6
- metadata.gz: e56288c902a448a532169703b9b8b49f95cc3e75a8b0351e8b893acf184caaf3090127b5f33c3c88ecaa0258afdc1d8b3312f963ea50aaaa7943bd7a97724c0a
7
- data.tar.gz: 1aed6aa3932542f098d7a200f7c94f4210b3151f308da23eb668f01ce1f9c3a03028cb8af2206d6cef1b632149370bbdd815dfa37c7a02e8aa42ccc042c996d2
6
+ metadata.gz: 67de885bfad88445121a98a4ea6ab576dc2c563e8848aca3d342623223e40cb93fa6db66cfde2290d0817f364bc323fa6d7576e522876407fc57c6dc44c99787
7
+ data.tar.gz: 55c51cf6b2d257c67cec056d9031c21889d23cd6c747917bd68f61039169d1ac8c3c18a5963a113dda6593c4b7db6d428b64bc74ed820ecc5159c1a5e77936de
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Mods
2
2
  # this is the Ruby Gem version
3
- VERSION = "2.3.0"
3
+ VERSION = "2.3.1"
4
4
  end
@@ -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.0
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-05 00:00:00.000000000 Z
12
+ date: 2017-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri