relaton-calconnect 1.10.0 → 1.10.1
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/grammars/biblio.rng +5 -3
- data/lib/relaton_calconnect/scrapper.rb +9 -13
- data/lib/relaton_calconnect/version.rb +1 -1
- data/relaton_calconnect.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28f0818beb318356e6c98999c461cfa4abfd2582f22771e42c93679b79acc0b6
|
4
|
+
data.tar.gz: 629eec258bb6b2ab488cb50731ec8a49248ea2b52fea97d8628f51dca3a495ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c2ee52411505f9e208aee08277ba956d66c74ddce6cdaa4b78700ac906ddc1caeaf10951f05e20a9e3666486d24c4fe5f4a763217ca0e5a073326f3ccc668e4
|
7
|
+
data.tar.gz: 83c61bb0b56e315db85647b46a889d8ec506905d9019ed675d4de31d1508500340d0b61a8df6ddcad21f29df828323c3b624694434f62f23fc0e2509c4854144
|
data/grammars/biblio.rng
CHANGED
@@ -209,9 +209,6 @@
|
|
209
209
|
<zeroOrMore>
|
210
210
|
<ref name="contact"/>
|
211
211
|
</zeroOrMore>
|
212
|
-
<zeroOrMore>
|
213
|
-
<ref name="uri"/>
|
214
|
-
</zeroOrMore>
|
215
212
|
</element>
|
216
213
|
</define>
|
217
214
|
<define name="fullname">
|
@@ -828,6 +825,11 @@
|
|
828
825
|
<optional>
|
829
826
|
<attribute name="scope"/>
|
830
827
|
</optional>
|
828
|
+
<optional>
|
829
|
+
<attribute name="primary">
|
830
|
+
<data type="boolean"/>
|
831
|
+
</attribute>
|
832
|
+
</optional>
|
831
833
|
<text/>
|
832
834
|
</element>
|
833
835
|
</define>
|
@@ -7,7 +7,7 @@ module RelatonCalconnect
|
|
7
7
|
class << self
|
8
8
|
# papam hit [Hash]
|
9
9
|
# @return [RelatonOgc::OrcBibliographicItem]
|
10
|
-
def parse_page(hit)
|
10
|
+
def parse_page(hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
11
11
|
links = array(hit["link"])
|
12
12
|
link = links.detect { |l| l["type"] == "rxl" }
|
13
13
|
if link
|
@@ -15,9 +15,11 @@ module RelatonCalconnect
|
|
15
15
|
update_links bib, links
|
16
16
|
# XMLParser.from_xml bib_xml
|
17
17
|
else
|
18
|
-
bib = RelatonCalconnect::CcBibliographicItem.from_hash doc_to_hash
|
18
|
+
bib = RelatonCalconnect::CcBibliographicItem.from_hash doc_to_hash hit
|
19
|
+
end
|
20
|
+
bib.link.each do |l|
|
21
|
+
l.content.merge!(scheme: SCHEME, host: HOST) unless l.content.host
|
19
22
|
end
|
20
|
-
bib.link.each { |l| l.content.merge!(scheme: SCHEME, host: HOST) unless l.content.host }
|
21
23
|
bib
|
22
24
|
end
|
23
25
|
|
@@ -25,16 +27,7 @@ module RelatonCalconnect
|
|
25
27
|
|
26
28
|
# @param url [String]
|
27
29
|
# @return [String] XML
|
28
|
-
def fetch_bib_xml(url)
|
29
|
-
# rxl = get_rxl url
|
30
|
-
# uri_rxl = rxl.at("uri[@type='rxl']")
|
31
|
-
# return rxl.to_xml unless uri_rxl
|
32
|
-
|
33
|
-
# uri_xml = rxl.xpath("//uri").to_xml
|
34
|
-
# rxl = get_rxl uri_rxl.text
|
35
|
-
# docid = rxl.at "//docidentifier"
|
36
|
-
# docid.add_previous_sibling uri_xml
|
37
|
-
# rxl.to_xml
|
30
|
+
def fetch_bib_xml(url) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
38
31
|
rxl = get_rxl url
|
39
32
|
uri_rxl = rxl.at("uri[@type='rxl']")
|
40
33
|
if uri_rxl
|
@@ -44,6 +37,7 @@ module RelatonCalconnect
|
|
44
37
|
docid.add_previous_sibling uri_xml
|
45
38
|
end
|
46
39
|
xml = rxl.to_xml.gsub!(%r{(</?)technical-committee(>)}, '\1committee\2')
|
40
|
+
.gsub(%r{type="(?:csd|CC)"(?=>)}i, '\0 primary="true"')
|
47
41
|
RelatonCalconnect::XMLParser.from_xml xml
|
48
42
|
end
|
49
43
|
|
@@ -66,6 +60,8 @@ module RelatonCalconnect
|
|
66
60
|
tc = eg.delete("technical_committee")
|
67
61
|
eg.merge!(tc) if tc
|
68
62
|
end
|
63
|
+
dtps = %w[CC CSD]
|
64
|
+
array(doc["docid"]).detect { |id| dtps.include? id["type"].upcase }["primary"] = true
|
69
65
|
doc
|
70
66
|
end
|
71
67
|
|
data/relaton_calconnect.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-calconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.10.
|
131
|
+
version: 1.10.1
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.10.
|
138
|
+
version: 1.10.1
|
139
139
|
description: 'RelatonIso: retrieve CC Standards for bibliographic use using the IsoBibliographicItem
|
140
140
|
model'
|
141
141
|
email:
|