relaton-ietf 1.10.2 → 1.10.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +1 -1
- data/lib/relaton_ietf/bibxml_parser.rb +9 -4
- data/lib/relaton_ietf/rfc_entry.rb +16 -6
- data/lib/relaton_ietf/rfc_index_entry.rb +2 -2
- data/lib/relaton_ietf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bdbf2b79c15e3a39c10694ba1ed129b825c6481f95939dfd322da43a3ea859e
|
4
|
+
data.tar.gz: da2f82d0c9ec214fbef2dd229f06d8dd9ffc0099c1eededcfbfca3e3d2cebd70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e435d1419778748b600048fd02881fa0cc32faa462fd50e95a1c837dcdd3c475ffd5f1cf0b143b1d20be38dae96dbdad3556d4b3d4954bc4a6de717da5cd0ec
|
7
|
+
data.tar.gz: dcf0ce8ce233f9f29073bea10b3abc4ffb9aa70f3749c88d3961fe01e6e157616237ded93e02ac664dba7c34a89da212880e2adb3d75949d176d41ff32491123
|
data/README.adoc
CHANGED
@@ -135,7 +135,7 @@ RelatonIetf::IetfBibliographicItem.from_hash hash
|
|
135
135
|
|
136
136
|
=== Fetch data
|
137
137
|
|
138
|
-
There
|
138
|
+
There are IETF datasets what can be converted into RelatonXML/BibXML/BibYAML formats:
|
139
139
|
|
140
140
|
- `ietf-rfcsubseries` - https://www.rfc-editor.org/rfc-index.xml (`<bcp-entry>`, `<fyi-entry>`, `<std-entry>`)
|
141
141
|
- `ietf-internet-drafts` - converts files from local directory `./bibxml-ids`. Use `rsync -avcizxL rsync.ietf.org::bibxml-ids ./bibxml-ids` command to fetch the files.
|
@@ -24,6 +24,7 @@ module RelatonIetf
|
|
24
24
|
type = super
|
25
25
|
case type
|
26
26
|
when "BCP", "FYI", "STD", "RFC" then "RFC"
|
27
|
+
when "Internet-Draft" then type
|
27
28
|
else "IETF"
|
28
29
|
end
|
29
30
|
end
|
@@ -37,10 +38,14 @@ module RelatonIetf
|
|
37
38
|
# @param reference [Nokogiri::XML::Element]
|
38
39
|
# @return [Array<Hash>]
|
39
40
|
def contributors(reference)
|
40
|
-
[
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
contribs = []
|
42
|
+
unless reference[:anchor]&.match?(/^I-D/)
|
43
|
+
contribs << {
|
44
|
+
entity: new_org("Internet Engineering Task Force", "IETF"),
|
45
|
+
role: [type: "publisher"],
|
46
|
+
}
|
47
|
+
end
|
48
|
+
contribs + super
|
44
49
|
# persons(reference) + organizations(reference)
|
45
50
|
end
|
46
51
|
end
|
@@ -68,7 +68,7 @@ module RelatonIetf
|
|
68
68
|
def parse_docid
|
69
69
|
ids = [
|
70
70
|
RelatonBib::DocumentIdentifier.new(id: pub_id, type: "IETF", primary: true),
|
71
|
-
RelatonBib::DocumentIdentifier.new(id:
|
71
|
+
RelatonBib::DocumentIdentifier.new(id: anchor, type: "IETF", scope: "anchor"),
|
72
72
|
]
|
73
73
|
doi = @doc.at("./xmlns:doi").text
|
74
74
|
ids << RelatonBib::DocumentIdentifier.new(id: doi, type: "DOI")
|
@@ -112,14 +112,22 @@ module RelatonIetf
|
|
112
112
|
@doc.at("./xmlns:doc-id").text
|
113
113
|
end
|
114
114
|
|
115
|
+
#
|
116
|
+
# Create acnhor
|
117
|
+
#
|
118
|
+
# @return [String] anchor
|
119
|
+
#
|
120
|
+
def anchor
|
121
|
+
"RFC#{docnum}"
|
122
|
+
end
|
123
|
+
|
115
124
|
#
|
116
125
|
# Create link
|
117
126
|
#
|
118
127
|
# @return [Array<RelatonBib::TypedUri>]
|
119
128
|
#
|
120
129
|
def parse_link
|
121
|
-
|
122
|
-
url = "https://www.rfc-editor.org/info/rfc#{num}"
|
130
|
+
url = "https://www.rfc-editor.org/info/rfc#{docnum}"
|
123
131
|
[RelatonBib::TypedUri.new(content: url, type: "src")]
|
124
132
|
end
|
125
133
|
|
@@ -256,11 +264,13 @@ module RelatonIetf
|
|
256
264
|
# @return [RelatonBib::EditorialGroup] document editorial group
|
257
265
|
#
|
258
266
|
def parse_editorialgroup
|
259
|
-
tc = @doc.xpath("./xmlns:wg_acronym").
|
267
|
+
tc = @doc.xpath("./xmlns:wg_acronym").each_with_object([]) do |wg, arr|
|
268
|
+
next if wg.text == "NON WORKING GROUP"
|
269
|
+
|
260
270
|
wg = RelatonBib::WorkGroup.new(name: wg.text)
|
261
|
-
RelatonBib::TechnicalCommittee.new(wg)
|
271
|
+
arr << RelatonBib::TechnicalCommittee.new(wg)
|
262
272
|
end
|
263
|
-
RelatonBib::EditorialGroup.new(tc)
|
273
|
+
RelatonBib::EditorialGroup.new(tc) if tc.any?
|
264
274
|
end
|
265
275
|
end
|
266
276
|
end
|
@@ -19,7 +19,7 @@ module RelatonIetf
|
|
19
19
|
#
|
20
20
|
# @param [Nokogiri::XML::Element] doc document
|
21
21
|
#
|
22
|
-
# @return [RelatonIetf
|
22
|
+
# @return [RelatonIetf::IetfBibliographicItem, nil]
|
23
23
|
#
|
24
24
|
def self.parse(doc)
|
25
25
|
doc_id = doc.at("./xmlns:doc-id")
|
@@ -55,7 +55,7 @@ module RelatonIetf
|
|
55
55
|
def parse_docid
|
56
56
|
[
|
57
57
|
RelatonBib::DocumentIdentifier.new(type: "IETF", id: pub_id, primary: true),
|
58
|
-
RelatonBib::DocumentIdentifier.new(type: "IETF", scope: "anchor", id:
|
58
|
+
RelatonBib::DocumentIdentifier.new(type: "IETF", scope: "anchor", id: anchor),
|
59
59
|
]
|
60
60
|
end
|
61
61
|
|
data/lib/relaton_ietf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ietf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.5
|
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-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|