relaton-bib 0.6.0 → 0.7.0

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
  SHA256:
3
- metadata.gz: 8ef89450c5deeab8305d50a98218ad8c6b8425904cfdc8918542fed5ee2790e5
4
- data.tar.gz: 60dccc2abedbb9f0bc940552d363c67d65b9c31c4bff4bde2d7e99ef3bc9a9a5
3
+ metadata.gz: 89eba8a2b96388c5ec85c3065c8a1df4f9e58f548f41cc4a31aeec5ee086e365
4
+ data.tar.gz: 2388ef34214483df6c1862481ac590f5478cf21e0d766104da290ad7ec1c7e63
5
5
  SHA512:
6
- metadata.gz: b5015108cf9f8e97cd39de74eb6db49886aafd43beb048c7a0dadd1013a5de31b565cd6bdd400cfcf068de4b421e593007962cfafbf82262e6f30a7a156e8fc8
7
- data.tar.gz: 1bc31977d22338c4491d1b45472746dec975e7b4ead6732437b6e206cb3f52e17ba8070a20ff84fd8cc7b6c69d5d2a4958ce4e1be958bb4ec4ab84495daddf5e
6
+ metadata.gz: 71c430b477177ecadd215af4c7e3e1255eda41fa48be5ef87c2b79a1ac88e93361d66cade1ed9a5a86c741db21454f2a6eff8f6383f7dc47f5877f1b1e123816
7
+ data.tar.gz: 7bf28cfb67462740134c7cfdd86445bb3d3ada541af4c9c6789f833e834558c634df786acfd5d86a826d3b9654b87c094bfc5d47dbb09b97b868b5c489ada40d
@@ -102,7 +102,7 @@ module RelatonBib
102
102
  attr_reader :extent
103
103
 
104
104
  # @return [Array<Strig>]
105
- attr_reader :accesslocation
105
+ attr_reader :accesslocation, :license
106
106
 
107
107
  # @return [Array<Relaton::Classification>]
108
108
  attr_reader :classification
@@ -227,6 +227,7 @@ module RelatonBib
227
227
  @validity = args[:validity]
228
228
  @fetched = args.fetch :fetched, nil # , Date.today # we should pass the fetched arg from scrappers
229
229
  @keyword = (args[:keyword] || []).map { |kw| LocalizedString.new(kw) }
230
+ @license = args.fetch :license, []
230
231
  end
231
232
  # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
232
233
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
@@ -309,6 +310,7 @@ module RelatonBib
309
310
  hash["validity"] = validity.to_hash if validity
310
311
  hash["fetched"] = fetched.to_s if fetched
311
312
  hash["keyword"] = single_element_array(keyword) if keyword&.any?
313
+ hash["license"] = single_element_array(license) if license&.any?
312
314
  hash
313
315
  end
314
316
 
@@ -526,6 +528,7 @@ module RelatonBib
526
528
  place.each { |pl| pl.to_xml builder }
527
529
  extent.each { |e| builder.extent { e.to_xml builder } }
528
530
  accesslocation.each { |al| builder.accesslocation al }
531
+ license.each { |l| builder.license l }
529
532
  classification.each { |cls| cls.to_xml builder }
530
533
  keyword.each { |kw| builder.keyword { kw.to_xml(builder) } }
531
534
  validity&.to_xml builder
@@ -26,6 +26,8 @@ module RelatonBib
26
26
  accesslocation_hash_to_bib(ret)
27
27
  classification_hash_to_bib(ret)
28
28
  validity_hash_to_bib(ret)
29
+ ret[:keyword] = array(ret[:keyword])
30
+ ret[:license] = array(ret[:license])
29
31
  ret
30
32
  end
31
33
 
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "0.6.0".freeze
2
+ VERSION = "0.7.0".freeze
3
3
  end
@@ -42,7 +42,8 @@ module RelatonBib
42
42
  extent: fetch_extent(bibitem),
43
43
  accesslocation: bibitem.xpath("./accesslocation").map(&:text),
44
44
  classification: fetch_classification(bibitem),
45
- keyword: fetch_keyword(bibitem),
45
+ keyword: bibitem.xpath("keyword").map(&:text),
46
+ license: bibitem.xpath("license").map(&:text),
46
47
  validity: fetch_validity(bibitem),
47
48
  }
48
49
  end
@@ -125,10 +126,6 @@ module RelatonBib
125
126
  end
126
127
  end
127
128
 
128
- def fetch_keyword(item)
129
- item.xpath("keyword").map &:text
130
- end
131
-
132
129
  def fetch_validity(item)
133
130
  vl = item.at("./validity")
134
131
  return unless vl
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-bib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-15 00:00:00.000000000 Z
11
+ date: 2020-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase