relaton-bib 0.6.0 → 0.7.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89eba8a2b96388c5ec85c3065c8a1df4f9e58f548f41cc4a31aeec5ee086e365
|
4
|
+
data.tar.gz: 2388ef34214483df6c1862481ac590f5478cf21e0d766104da290ad7ec1c7e63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/relaton_bib/version.rb
CHANGED
@@ -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:
|
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.
|
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-
|
11
|
+
date: 2020-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|