relaton-ietf 1.9.5 → 1.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_ietf/data_fetcher.rb +1 -2
- data/lib/relaton_ietf/processor.rb +1 -1
- data/lib/relaton_ietf/rfc_index_entry.rb +52 -25
- 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: 05d7da0539d628af6e8dbe016497f640fe1a238c164e280e6d9bae3152de3bb5
|
4
|
+
data.tar.gz: 4d7da3f63909c912630f6b2d2ac7c2224219662a6cd8ce840f4156bb59072e18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 688aefaa75847bfbb3dd9dc41dd91367b0e5749d78f2ef0f93296270d25165b69708a5a20367231df67525d536755f5eeef9c9f1f242a3e7b895381fac41f427
|
7
|
+
data.tar.gz: adc30f681ff6be584b9025aaad6d14ffa728a1bb82b10caac5d88a14954017dfc9a6328fd34c9f13176c3e9a2a3496b676d18d8405070bf00b92c5b15536f380
|
@@ -17,7 +17,7 @@ module RelatonIetf
|
|
17
17
|
def initialize(source, output, format)
|
18
18
|
@source = source
|
19
19
|
@output = output
|
20
|
-
@format =
|
20
|
+
@format = format
|
21
21
|
@ext = @format.sub(/^bib|^rfc/, "")
|
22
22
|
@files = []
|
23
23
|
end
|
@@ -99,7 +99,6 @@ module RelatonIetf
|
|
99
99
|
c = case @format
|
100
100
|
when "xml" then entry.to_xml(bibdata: true)
|
101
101
|
when "yaml" then entry.to_hash.to_yaml
|
102
|
-
when "rfcxml" then entry.to_xml
|
103
102
|
else entry.send("to_#{@format}")
|
104
103
|
end
|
105
104
|
file = file_name entry
|
@@ -6,7 +6,7 @@ module RelatonIetf
|
|
6
6
|
def initialize # rubocop:disable Lint/MissingSuper
|
7
7
|
@short = :relaton_ietf
|
8
8
|
@prefix = "IETF"
|
9
|
-
@defaultprefix = /^RFC
|
9
|
+
@defaultprefix = /^(IETF|RFC|BCP)\s/
|
10
10
|
@idtype = "IETF"
|
11
11
|
@datasets = %w[ietf-rfcsubseries ietf-internet-drafts ietf-rfc-entries]
|
12
12
|
end
|
@@ -3,8 +3,9 @@ module RelatonIetf
|
|
3
3
|
#
|
4
4
|
# Document parser initalization
|
5
5
|
#
|
6
|
+
# @param [String] name document type name
|
6
7
|
# @param [String] doc_id document id
|
7
|
-
# @param [Array<String>] is_also
|
8
|
+
# @param [Array<String>] is_also included document ids
|
8
9
|
#
|
9
10
|
def initialize(name, doc_id, is_also)
|
10
11
|
@name = name
|
@@ -13,15 +14,6 @@ module RelatonIetf
|
|
13
14
|
@is_also = is_also
|
14
15
|
end
|
15
16
|
|
16
|
-
#
|
17
|
-
# Document id
|
18
|
-
#
|
19
|
-
# @return [Strinng] document id
|
20
|
-
#
|
21
|
-
def docnumber
|
22
|
-
@doc_id
|
23
|
-
end
|
24
|
-
|
25
17
|
#
|
26
18
|
# Initialize document parser and run it
|
27
19
|
#
|
@@ -35,26 +27,61 @@ module RelatonIetf
|
|
35
27
|
return unless doc_id && is_also.any?
|
36
28
|
|
37
29
|
name = doc.name.split("-").first
|
38
|
-
new(name, doc_id.text, is_also)
|
30
|
+
new(name, doc_id.text, is_also).parse
|
31
|
+
end
|
32
|
+
|
33
|
+
def parse
|
34
|
+
IetfBibliographicItem.new(
|
35
|
+
docnumber: docnumber,
|
36
|
+
type: "standard",
|
37
|
+
docid: parse_docid,
|
38
|
+
language: ["en"],
|
39
|
+
script: ["Latn"],
|
40
|
+
link: parse_link,
|
41
|
+
formattedref: formattedref,
|
42
|
+
relation: parse_relation,
|
43
|
+
)
|
39
44
|
end
|
40
45
|
|
41
46
|
#
|
42
|
-
#
|
47
|
+
# Document id
|
43
48
|
#
|
44
|
-
# @return [
|
49
|
+
# @return [Strinng] document id
|
45
50
|
#
|
46
|
-
def
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
51
|
+
def docnumber
|
52
|
+
@doc_id
|
53
|
+
end
|
54
|
+
|
55
|
+
def parse_docid
|
56
|
+
[
|
57
|
+
RelatonBib::DocumentIdentifier.new(type: "IETF", id: pub_id),
|
58
|
+
RelatonBib::DocumentIdentifier.new(type: "rfc-anchor", id: anchor),
|
59
|
+
]
|
60
|
+
end
|
61
|
+
|
62
|
+
def pub_id
|
63
|
+
"IETF #{@name.upcase} #{@shortnum}"
|
64
|
+
end
|
65
|
+
|
66
|
+
def anchor
|
67
|
+
"#{@name.upcase}#{@shortnum}"
|
68
|
+
end
|
69
|
+
|
70
|
+
def parse_link
|
71
|
+
[RelatonBib::TypedUri.new(type: "src", content: "https://www.rfc-editor.org/info/#{@name}#{@shortnum}")]
|
72
|
+
end
|
73
|
+
|
74
|
+
def formattedref
|
75
|
+
RelatonBib::FormattedRef.new(
|
76
|
+
content: anchor, language: "en", script: "Latn",
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
def parse_relation
|
81
|
+
@is_also.map do |ref|
|
82
|
+
bib = IetfBibliography.get ref.sub(/^(RFC)(\d+)/, '\1 \2')
|
83
|
+
{ type: "includes", bibitem: bib }
|
84
|
+
end
|
58
85
|
end
|
59
86
|
end
|
60
87
|
end
|
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.9.
|
4
|
+
version: 1.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|