relaton-ietf 1.5.0 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +2 -0
- data/grammars/isodoc.rng +14 -43
- data/lib/relaton_ietf.rb +1 -6
- data/lib/relaton_ietf/hash_converter.rb +8 -17
- data/lib/relaton_ietf/scrapper.rb +65 -96
- data/lib/relaton_ietf/version.rb +1 -1
- data/relaton_ietf.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: fe0909b3d346a37c7e6363a2c1b4c2822464b1b8bcaa589e3b9efad9148b24a8
|
4
|
+
data.tar.gz: b1a22b2905d52f0f014a27ea7eb11abe049ec62c2e6918818c6ca5cf3e2af843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 151fddd3a5168eb80b1fcd0f86a33f58ab222993457c2c1eb8b24a03ccf976b4048b01e7a7ff182957c846a258fe77602114f2de394b285b6291e16baca2cd35
|
7
|
+
data.tar.gz: '08ed81561c2737cc7852c868990064e4bf23bfd270c24f55ecb6948b6b97e7bcff09274baebab5d4003797c0babc1fc1c4dfabbd19e72cfd33e73f05533b4e13'
|
data/.github/workflows/macos.yml
CHANGED
@@ -26,6 +26,8 @@ jobs:
|
|
26
26
|
- name: Update gems
|
27
27
|
run: |
|
28
28
|
sudo gem install bundler --force
|
29
|
+
ruby -v | grep 2.5 && bundle config set build.debase --with-cflags="-Wno-error=implicit-function-declaration"
|
30
|
+
ruby -v | grep 2.5 && bundle config set build.ruby-debug-ide --with-cflags="-Wno-error=implicit-function-declaration"
|
29
31
|
bundle install --jobs 4 --retry 3
|
30
32
|
- name: Run specs
|
31
33
|
run: |
|
data/grammars/isodoc.rng
CHANGED
@@ -24,6 +24,14 @@
|
|
24
24
|
<start>
|
25
25
|
<ref name="standard-document"/>
|
26
26
|
</start>
|
27
|
+
<define name="doctype">
|
28
|
+
<element name="doctype">
|
29
|
+
<optional>
|
30
|
+
<attribute name="abbreviation"/>
|
31
|
+
</optional>
|
32
|
+
<ref name="DocumentType"/>
|
33
|
+
</element>
|
34
|
+
</define>
|
27
35
|
<define name="hyperlink">
|
28
36
|
<element name="link">
|
29
37
|
<attribute name="target">
|
@@ -141,6 +149,11 @@
|
|
141
149
|
<data type="boolean"/>
|
142
150
|
</attribute>
|
143
151
|
</optional>
|
152
|
+
<optional>
|
153
|
+
<attribute name="key">
|
154
|
+
<data type="boolean"/>
|
155
|
+
</attribute>
|
156
|
+
</optional>
|
144
157
|
<oneOrMore>
|
145
158
|
<ref name="dt"/>
|
146
159
|
<ref name="dd"/>
|
@@ -1164,49 +1177,7 @@
|
|
1164
1177
|
</define>
|
1165
1178
|
<define name="annex">
|
1166
1179
|
<element name="annex">
|
1167
|
-
<
|
1168
|
-
<attribute name="id">
|
1169
|
-
<data type="ID"/>
|
1170
|
-
</attribute>
|
1171
|
-
</optional>
|
1172
|
-
<optional>
|
1173
|
-
<attribute name="language"/>
|
1174
|
-
</optional>
|
1175
|
-
<optional>
|
1176
|
-
<attribute name="script"/>
|
1177
|
-
</optional>
|
1178
|
-
<optional>
|
1179
|
-
<attribute name="inline-header">
|
1180
|
-
<data type="boolean"/>
|
1181
|
-
</attribute>
|
1182
|
-
</optional>
|
1183
|
-
<attribute name="obligation">
|
1184
|
-
<choice>
|
1185
|
-
<value>normative</value>
|
1186
|
-
<value>informative</value>
|
1187
|
-
</choice>
|
1188
|
-
</attribute>
|
1189
|
-
<optional>
|
1190
|
-
<ref name="section-title"/>
|
1191
|
-
</optional>
|
1192
|
-
<group>
|
1193
|
-
<group>
|
1194
|
-
<zeroOrMore>
|
1195
|
-
<ref name="BasicBlock"/>
|
1196
|
-
</zeroOrMore>
|
1197
|
-
<zeroOrMore>
|
1198
|
-
<ref name="note"/>
|
1199
|
-
</zeroOrMore>
|
1200
|
-
</group>
|
1201
|
-
<zeroOrMore>
|
1202
|
-
<choice>
|
1203
|
-
<ref name="annex-subsection"/>
|
1204
|
-
<ref name="terms"/>
|
1205
|
-
<ref name="definitions"/>
|
1206
|
-
<ref name="references"/>
|
1207
|
-
</choice>
|
1208
|
-
</zeroOrMore>
|
1209
|
-
</group>
|
1180
|
+
<ref name="Annex-Section"/>
|
1210
1181
|
</element>
|
1211
1182
|
</define>
|
1212
1183
|
<define name="terms">
|
data/lib/relaton_ietf.rb
CHANGED
@@ -6,11 +6,6 @@ require "relaton_ietf/ietf_bibliographic_item"
|
|
6
6
|
require "relaton_ietf/xml_parser"
|
7
7
|
require "relaton_ietf/hash_converter"
|
8
8
|
|
9
|
-
# if defined? Relaton
|
10
|
-
# require_relative "relaton_ietf/processor"
|
11
|
-
# Relaton::Registry.instance.register(RelatonIetf::Processor)
|
12
|
-
# end
|
13
|
-
|
14
9
|
require "relaton/provider_ietf"
|
15
10
|
|
16
11
|
module RelatonIetf
|
@@ -22,4 +17,4 @@ module RelatonIetf
|
|
22
17
|
grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
|
23
18
|
Digest::MD5.hexdigest grammars
|
24
19
|
end
|
25
|
-
end
|
20
|
+
end
|
@@ -1,23 +1,14 @@
|
|
1
1
|
module RelatonIetf
|
2
2
|
class HashConverter < RelatonBib::HashConverter
|
3
3
|
class << self
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
# @
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# doctype_hash_to_bib(ret)
|
13
|
-
# ret
|
14
|
-
# end
|
15
|
-
|
16
|
-
# private
|
17
|
-
|
18
|
-
# def doctype_hash_to_bib(ret)
|
19
|
-
# ret
|
20
|
-
# end
|
4
|
+
#
|
5
|
+
# Ovverides superclass's method
|
6
|
+
#
|
7
|
+
# @param item [Hash]
|
8
|
+
# @retirn [RelatonIec::IecBibliographicItem]
|
9
|
+
def bib_item(item)
|
10
|
+
IetfBibliographicItem.new(item)
|
11
|
+
end
|
21
12
|
end
|
22
13
|
end
|
23
14
|
end
|
@@ -10,44 +10,31 @@ module RelatonIetf
|
|
10
10
|
|
11
11
|
# Scrapper module
|
12
12
|
module Scrapper
|
13
|
-
|
14
|
-
# ID_URI_PATTERN = "https://xml2rfc.tools.ietf.org/public/rfc/bibxml-ids/reference.CODE"
|
13
|
+
GH_URL = "https://raw.githubusercontent.com/relaton/relaton-data-ietf/master/data/reference."
|
15
14
|
BCP_URI_PATTERN = "https://www.rfc-editor.org/info/CODE"
|
16
15
|
|
17
16
|
class << self
|
18
|
-
# rubocop:disable Metrics/MethodLength
|
19
|
-
|
20
17
|
# @param text [String]
|
21
18
|
# @param is_relation [TrueClass, FalseClass]
|
22
19
|
# @return [RelatonIetf::IetfBibliographicItem]
|
23
20
|
def scrape_page(text, is_relation = false)
|
24
21
|
# Remove initial "IETF " string if specified
|
25
22
|
ref = text.gsub(/^IETF /, "")
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
when /^I-D/ then rfc_item ["3"], ref, is_relation
|
30
|
-
when /^W3C/ then rfc_item ["4", "2"], ref, is_relation
|
31
|
-
when /^(ANSI|CCITT|FIPS|IANA|ISO|ITU|NIST|OASIS|PKCS)/
|
32
|
-
rfc_item ["2"], ref, is_relation
|
33
|
-
when /^(3GPP|SDO-3GPP)/ then rfc_item ["5"], ref, is_relation
|
34
|
-
when /^IEEE/ then rfc_item ["6", "2"], ref, is_relation
|
35
|
-
when /^BCP/ then bcp_item BCP_URI_PATTERN.dup, ref
|
36
|
-
else
|
37
|
-
raise RelatonBib::RequestError, "#{ref}: not recognised for RFC"
|
38
|
-
end
|
23
|
+
/^(RFC|BCP|FYI|STD)\s(?<num>\d+)/ =~ ref
|
24
|
+
ref.sub! /(?<=^(?:RFC|BCP|FYI|STD)\s)(\d+)/, num.rjust(4, "0") if num
|
25
|
+
rfc_item ref, is_relation
|
39
26
|
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
40
27
|
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
|
41
28
|
Net::ProtocolError, SocketError
|
42
29
|
raise RelatonBib::RequestError, "No document found for #{ref} reference."
|
43
30
|
end
|
44
31
|
|
45
|
-
# @param reference [
|
32
|
+
# @param reference [Nokogiri::XML::Element, nil]
|
46
33
|
# @param is_relation [TrueClass, FalseClass]
|
47
34
|
# @param url [String, NilClass]
|
48
35
|
# @param ver [String, NilClass] Internet Draft version
|
49
36
|
# @return [RelatonIetf::IetfBibliographicItem]
|
50
|
-
def fetch_rfc(reference, is_relation = false, url = nil, ver = nil)
|
37
|
+
def fetch_rfc(reference, is_relation = false, url = nil, ver = nil) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
51
38
|
return unless reference
|
52
39
|
|
53
40
|
ietf_item(
|
@@ -59,23 +46,24 @@ module RelatonIetf
|
|
59
46
|
language: [language(reference)],
|
60
47
|
link: link(reference, url, ver),
|
61
48
|
title: titles(reference),
|
49
|
+
formattedref: formattedref(reference),
|
62
50
|
abstract: abstracts(reference),
|
63
51
|
contributor: contributors(reference),
|
52
|
+
relation: relations(reference),
|
64
53
|
date: dates(reference),
|
65
54
|
series: series(reference),
|
66
55
|
place: ["Fremont, CA"],
|
67
56
|
keyword: reference.xpath("front/keyword").map(&:text),
|
68
|
-
doctype: doctype(reference[:anchor])
|
57
|
+
doctype: doctype(reference[:anchor])
|
69
58
|
)
|
70
59
|
end
|
71
|
-
# rubocop:enable Metrics/MethodLength
|
72
60
|
|
73
61
|
private
|
74
62
|
|
75
63
|
# @param anchor [String]
|
76
64
|
# @return [String]
|
77
65
|
def doctype(anchor)
|
78
|
-
anchor
|
66
|
+
anchor&.include?("I-D") ? "internet-draft" : "rfc"
|
79
67
|
end
|
80
68
|
|
81
69
|
# @param reference [Nokogiri::XML::Element]
|
@@ -86,7 +74,7 @@ module RelatonIetf
|
|
86
74
|
l = []
|
87
75
|
l << { type: "xml", content: url } if url
|
88
76
|
l << { type: "src", content: reference[:target] } if reference[:target]
|
89
|
-
if reference[:anchor]
|
77
|
+
if /^I-D/.match? reference[:anchor]
|
90
78
|
reference.xpath("format").each do |f|
|
91
79
|
c = ver ? f[:target].sub(/(?<=-)\d{2}(?=\.)/, ver) : f[:target]
|
92
80
|
l << { type: f[:type], content: c }
|
@@ -103,57 +91,30 @@ module RelatonIetf
|
|
103
91
|
RelatonIetf::IetfBibliographicItem.new **attrs
|
104
92
|
end
|
105
93
|
|
106
|
-
# @param uri_nums [Array<String>]
|
107
94
|
# @param ref [String]
|
108
95
|
# @return [RelatonIetf::IetfBibliographicItem]
|
109
|
-
def rfc_item(
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
/(
|
114
|
-
if n == "3"
|
115
|
-
ref.sub! /-\d{2}/, "" if ver
|
116
|
-
ref.sub! /(?<=I-D\.)draft-/, ""
|
117
|
-
end
|
118
|
-
|
119
|
-
uri = "#{RFC_URI_PATTERN}#{n}/reference.#{ref.sub(/\s|\u00a0/, ".")}.xml"
|
120
|
-
begin
|
121
|
-
doc = Nokogiri::XML get_page(uri)
|
122
|
-
resp = fetch_rfc doc.at("//reference"), is_relation, uri, ver
|
123
|
-
return resp if resp
|
124
|
-
rescue RelatonBib::RequestError => e
|
125
|
-
error = e
|
126
|
-
end
|
96
|
+
def rfc_item(ref, is_relation)
|
97
|
+
/(?<=-)(?<ver>\d{2})$/ =~ ref
|
98
|
+
if /^I-D/.match? ref
|
99
|
+
ref.sub! /-\d{2}/, "" if ver
|
100
|
+
ref.sub! /(?<=I-D\.)draft-/, ""
|
127
101
|
end
|
128
|
-
raise error
|
129
|
-
end
|
130
102
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
def bcp_item(uri_template, reference)
|
135
|
-
uri = uri_template.sub "CODE", reference.sub(" ", "").downcase
|
136
|
-
doc = Nokogiri::HTML get_page(uri)
|
137
|
-
ietf_item(
|
138
|
-
id: reference,
|
139
|
-
title: [content: ""],
|
140
|
-
docid: [RelatonBib::DocumentIdentifier.new(type: "IETF", id: reference)],
|
141
|
-
language: ["en"],
|
142
|
-
link: [{ type: "src", content: uri }],
|
143
|
-
relation: fetch_relations(doc),
|
144
|
-
doctype: "rfc",
|
145
|
-
)
|
103
|
+
uri = "#{GH_URL}#{ref.sub(/\s|\u00a0/, '.')}.xml"
|
104
|
+
doc = Nokogiri::XML get_page(uri)
|
105
|
+
fetch_rfc doc.at("/referencegroup", "/reference"), is_relation, uri, ver
|
146
106
|
end
|
147
107
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
)
|
108
|
+
# @param reference [Nokogiri::XML::Element]
|
109
|
+
# @return [Hash]
|
110
|
+
def relations(reference)
|
111
|
+
reference.xpath("reference").map do |ref|
|
112
|
+
{ type: "includes", bibitem: fetch_rfc(ref, true) }
|
154
113
|
end
|
155
114
|
end
|
156
115
|
|
116
|
+
# @param uri [String]
|
117
|
+
# @return [String] HTTP response body
|
157
118
|
def get_page(uri)
|
158
119
|
res = Net::HTTP.get_response(URI(uri))
|
159
120
|
if res.code != "200"
|
@@ -163,21 +124,30 @@ module RelatonIetf
|
|
163
124
|
res.body
|
164
125
|
end
|
165
126
|
|
166
|
-
#
|
167
|
-
# uri_template.gsub("CODE", reference)
|
168
|
-
# end
|
169
|
-
|
127
|
+
# @param reference [Nokogiri::XML::Element]
|
170
128
|
# @return [String]
|
171
129
|
def language(reference)
|
172
130
|
reference[:lang] || "en"
|
173
131
|
end
|
174
132
|
|
133
|
+
# @param reference [Nokogiri::XML::Element]
|
175
134
|
# @return [Array<Hash>]
|
176
135
|
def titles(reference)
|
177
|
-
|
178
|
-
|
136
|
+
reference.xpath("./front/title").map do |title|
|
137
|
+
{ content: title.text, language: language(reference), script: "Latn" }
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# @param reference [Nokogiri::XML::Element]
|
142
|
+
# @return [RelatonBib::FormattedRef, nil]
|
143
|
+
def formattedref(reference)
|
144
|
+
return if reference.at "./fornt/title"
|
145
|
+
|
146
|
+
cont = (reference[:anchor] || reference[:docName] || reference[:number])
|
147
|
+
RelatonBib::FormattedRef.new content: cont, language: language(reference), script: "Latn" if cont
|
179
148
|
end
|
180
149
|
|
150
|
+
# @param reference [Nokogiri::XML::Element]
|
181
151
|
# @return [Array<RelatonBib::FormattedString>]
|
182
152
|
def abstracts(ref)
|
183
153
|
ref.xpath("./front/abstract").map do |a|
|
@@ -188,24 +158,27 @@ module RelatonIetf
|
|
188
158
|
end
|
189
159
|
end
|
190
160
|
|
161
|
+
# @param reference [Nokogiri::XML::Element]
|
191
162
|
# @return [Array<Hash>]
|
192
163
|
def contributors(reference)
|
193
164
|
persons(reference) + organizations(reference)
|
194
165
|
end
|
195
166
|
|
167
|
+
# @param reference [Nokogiri::XML::Element]
|
196
168
|
# @return [Array<Hash{Symbol=>RelatonBib::Person,Symbol=>Array<String>}>]
|
197
169
|
def persons(reference)
|
198
|
-
reference.xpath("./front/author[@surname]|./front/author[@fullname]")
|
199
|
-
map do |author|
|
170
|
+
reference.xpath("./front/author[@surname]|./front/author[@fullname]")
|
171
|
+
.map do |author|
|
200
172
|
entity = RelatonBib::Person.new(
|
201
173
|
name: full_name(author, reference),
|
202
174
|
affiliation: [affiliation(author)],
|
203
|
-
contact: contacts(author.at("./address"))
|
175
|
+
contact: contacts(author.at("./address"))
|
204
176
|
)
|
205
177
|
{ entity: entity, role: [contributor_role(author)] }
|
206
178
|
end
|
207
179
|
end
|
208
180
|
|
181
|
+
# @param reference [Nokogiri::XML::Element]
|
209
182
|
# @return [Array<Hash{Symbol=>RelatonBib::Organization,Symbol=>Array<String>}>]
|
210
183
|
def organizations(reference)
|
211
184
|
publisher = { entity: new_org, role: [type: "publisher"] }
|
@@ -215,21 +188,21 @@ module RelatonIetf
|
|
215
188
|
mem << { entity: new_org(si[:stream], nil), role: [type: "author"] }
|
216
189
|
end
|
217
190
|
orgs + reference.xpath(
|
218
|
-
"front/author[not(@surname)][not(@fullname)]/organization"
|
191
|
+
"front/author[not(@surname)][not(@fullname)]/organization"
|
219
192
|
).map do |org|
|
220
193
|
{ entity: new_org(org.text, nil), role: [type: "author"] }
|
221
194
|
end
|
222
195
|
end
|
223
196
|
|
224
|
-
# @param author [Nokogiri::XML::
|
225
|
-
# @param ref [Nokogiri::XML::
|
197
|
+
# @param author [Nokogiri::XML::Element]
|
198
|
+
# @param ref [Nokogiri::XML::Element]
|
226
199
|
# @return [RelatonBib::FullName]
|
227
200
|
def full_name(author, ref)
|
228
201
|
lang = language ref
|
229
202
|
RelatonBib::FullName.new(
|
230
203
|
completename: localized_string(author[:fullname], lang),
|
231
204
|
initial: [localized_string(author[:initials], lang)].compact,
|
232
|
-
surname: localized_string(author[:surname], lang)
|
205
|
+
surname: localized_string(author[:surname], lang)
|
233
206
|
)
|
234
207
|
end
|
235
208
|
|
@@ -242,7 +215,7 @@ module RelatonIetf
|
|
242
215
|
RelatonBib::LocalizedString.new(content, lang)
|
243
216
|
end
|
244
217
|
|
245
|
-
# @param postal [Nokogiri::XML::
|
218
|
+
# @param postal [Nokogiri::XML::Element]
|
246
219
|
# @return [Array<RelatonBib::Address, RelatonBib::Phone>]
|
247
220
|
def contacts(addr)
|
248
221
|
contacts = []
|
@@ -256,15 +229,15 @@ module RelatonIetf
|
|
256
229
|
contacts
|
257
230
|
end
|
258
231
|
|
259
|
-
# @param postal [Nokogiri::XML::
|
232
|
+
# @param postal [Nokogiri::XML::Element]
|
260
233
|
# @rerurn [RelatonBib::Address]
|
261
|
-
def address(postal)
|
234
|
+
def address(postal) # rubocop:disable Metrics/CyclomaticComplexity
|
262
235
|
RelatonBib::Address.new(
|
263
236
|
street: [(postal.at("./postalLine") || postal.at("./street"))&.text],
|
264
237
|
city: postal.at("./city")&.text,
|
265
238
|
postcode: postal.at("./code")&.text,
|
266
239
|
country: postal.at("./country")&.text,
|
267
|
-
state: postal.at("./region")&.text
|
240
|
+
state: postal.at("./region")&.text
|
268
241
|
)
|
269
242
|
end
|
270
243
|
|
@@ -276,7 +249,7 @@ module RelatonIetf
|
|
276
249
|
contacts << RelatonBib::Contact.new(type: type, value: value.text)
|
277
250
|
end
|
278
251
|
|
279
|
-
# @param author [Nokogiri::XML::
|
252
|
+
# @param author [Nokogiri::XML::Element]
|
280
253
|
# @return [RelatonBib::Affiliation]
|
281
254
|
def affiliation(author)
|
282
255
|
organization = author.at("./organization")
|
@@ -303,7 +276,7 @@ module RelatonIetf
|
|
303
276
|
|
304
277
|
def month(mon)
|
305
278
|
return 1 if !mon || mon.empty?
|
306
|
-
return mon if /^\d
|
279
|
+
return mon if /^\d+$/.match? mon
|
307
280
|
|
308
281
|
Date::MONTHNAMES.index(mon)
|
309
282
|
end
|
@@ -311,6 +284,7 @@ module RelatonIetf
|
|
311
284
|
#
|
312
285
|
# Extract date from reference.
|
313
286
|
#
|
287
|
+
# @param reference [Nokogiri::XML::Element]
|
314
288
|
# @return [Array<RelatonBib::BibliographicDate>] published data.
|
315
289
|
#
|
316
290
|
def dates(reference)
|
@@ -322,8 +296,6 @@ module RelatonIetf
|
|
322
296
|
[RelatonBib::BibliographicDate.new(type: "published", on: date)]
|
323
297
|
end
|
324
298
|
|
325
|
-
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
326
|
-
|
327
299
|
#
|
328
300
|
# Extract document identifiers from reference
|
329
301
|
#
|
@@ -332,12 +304,12 @@ module RelatonIetf
|
|
332
304
|
#
|
333
305
|
# @return [Array<RelatonBib::DocumentIdentifier>]
|
334
306
|
#
|
335
|
-
def docids(reference, ver)
|
307
|
+
def docids(reference, ver) # rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/AbcSize
|
336
308
|
id = (reference[:anchor] || reference[:docName] || reference[:number])
|
337
309
|
ret = []
|
338
310
|
if id
|
339
311
|
ret << RelatonBib::DocumentIdentifier.new(
|
340
|
-
type: "IETF", id: id.sub(/^(RFC)/, "\\1 ")
|
312
|
+
type: "IETF", id: id.sub(/^(RFC)/, "\\1 ")
|
341
313
|
)
|
342
314
|
end
|
343
315
|
if (id = reference[:anchor])
|
@@ -351,11 +323,10 @@ module RelatonIetf
|
|
351
323
|
RelatonBib::DocumentIdentifier.new(id: id, type: si[:name])
|
352
324
|
end.compact
|
353
325
|
end
|
354
|
-
# enable Metrics/MethodLength, Metrics/AbcSize
|
355
326
|
|
356
327
|
#
|
357
328
|
# Extract series form reference
|
358
|
-
# @param reference [Nokogiri::XML::
|
329
|
+
# @param reference [Nokogiri::XML::Element]
|
359
330
|
#
|
360
331
|
# @return [Array<RelatonBib::Series>]
|
361
332
|
#
|
@@ -365,17 +336,17 @@ module RelatonIetf
|
|
365
336
|
|
366
337
|
RelatonBib::Series.new(
|
367
338
|
title: RelatonBib::TypedTitleString.new(
|
368
|
-
content: si[:name], language: language(reference), script: "Latn"
|
339
|
+
content: si[:name], language: language(reference), script: "Latn"
|
369
340
|
),
|
370
341
|
number: si[:value],
|
371
|
-
type: "main"
|
342
|
+
type: "main"
|
372
343
|
)
|
373
344
|
end.compact
|
374
345
|
end
|
375
346
|
|
376
347
|
#
|
377
348
|
# extract status
|
378
|
-
# @param reference [Nokogiri::XML::
|
349
|
+
# @param reference [Nokogiri::XML::Element]
|
379
350
|
#
|
380
351
|
# @return [RelatonBib::DocumentStatus]
|
381
352
|
#
|
@@ -383,9 +354,7 @@ module RelatonIetf
|
|
383
354
|
st = reference.at("./seriesinfo[@status]")
|
384
355
|
return unless st
|
385
356
|
|
386
|
-
RelatonBib::DocumentStatus.new(
|
387
|
-
stage: st[:status],
|
388
|
-
)
|
357
|
+
RelatonBib::DocumentStatus.new(stage: st[:status])
|
389
358
|
end
|
390
359
|
end
|
391
360
|
end
|
data/lib/relaton_ietf/version.rb
CHANGED
data/relaton_ietf.gemspec
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.
|
4
|
+
version: 1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: 1.7.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
166
|
+
version: 1.7.0
|
167
167
|
description: "RelatonIetf: retrieve IETF Standards for bibliographic use \nusing the
|
168
168
|
BibliographicItem model.\n\nFormerly known as rfcbib.\n"
|
169
169
|
email:
|