relaton-ietf 1.9.11 → 1.9.12
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/.gitignore +1 -0
- data/lib/relaton_ietf/rfc_entry.rb +34 -5
- 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: c189b76c5cd1565d79d2b910449c708bd759419e38fafd7cc8a96d0bfc2eab9a
|
|
4
|
+
data.tar.gz: cefad1d99e228226e1ac6ac5fdaf627911006a1e67d8ed93babb108150f4631b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fec8da43d98eadd06a4e511399fee9832dccbd4783a69268bd4762901270051c4eb275b8c91b9da3d9360fe86ba740e488d263cd697884f144a3749dfc6e26bf
|
|
7
|
+
data.tar.gz: 4a7c370e2e1825df2474be9796855f024aed008c30f737e087abb0bf8b02aed03d1332221c3eb8f71a7a3d51913eee215c1b77c21e6848ab01731e77fa8b5da6
|
data/.gitignore
CHANGED
|
@@ -41,10 +41,25 @@ module RelatonIetf
|
|
|
41
41
|
abstract: parse_abstract,
|
|
42
42
|
relation: parse_relation,
|
|
43
43
|
status: parse_status,
|
|
44
|
+
series: parse_series,
|
|
44
45
|
editorialgroup: parse_editorialgroup,
|
|
45
46
|
)
|
|
46
47
|
end
|
|
47
48
|
|
|
49
|
+
#
|
|
50
|
+
# Parse series
|
|
51
|
+
#
|
|
52
|
+
# @return [Array<RelatonBib::Series>] series
|
|
53
|
+
#
|
|
54
|
+
def parse_series
|
|
55
|
+
title = RelatonBib::TypedTitleString.new(content: "RFC")
|
|
56
|
+
@doc.xpath("./xmlns:is-also/xmlns:doc-id").map do |s|
|
|
57
|
+
/^(?<name>\D+)(?<num>\d+)/ =~ s.text
|
|
58
|
+
t = RelatonBib::TypedTitleString.new(content: name)
|
|
59
|
+
RelatonBib::Series.new title: t, number: num.gsub(/^0+/, "")
|
|
60
|
+
end + [RelatonBib::Series.new(title: title, number: docnum)]
|
|
61
|
+
end
|
|
62
|
+
|
|
48
63
|
#
|
|
49
64
|
# Parse document identifiers
|
|
50
65
|
#
|
|
@@ -76,8 +91,16 @@ module RelatonIetf
|
|
|
76
91
|
# @return [String] PubID
|
|
77
92
|
#
|
|
78
93
|
def pub_id
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
"RFC #{docnum}"
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
#
|
|
98
|
+
# Parse document number
|
|
99
|
+
#
|
|
100
|
+
# @return [String] document number
|
|
101
|
+
#
|
|
102
|
+
def docnum
|
|
103
|
+
/\d+$/.match(code).to_s.sub(/^0+/, "")
|
|
81
104
|
end
|
|
82
105
|
|
|
83
106
|
#
|
|
@@ -122,8 +145,11 @@ module RelatonIetf
|
|
|
122
145
|
def parse_contributor
|
|
123
146
|
@doc.xpath("./xmlns:author").map do |contributor|
|
|
124
147
|
n = contributor.at("./xmlns:name").text
|
|
125
|
-
|
|
126
|
-
|
|
148
|
+
int, snm = n.split
|
|
149
|
+
initial = [RelatonBib::LocalizedString.new(int, "en", "Latn")]
|
|
150
|
+
surname = RelatonBib::LocalizedString.new(snm, "en", "Latn")
|
|
151
|
+
name = RelatonBib::LocalizedString.new(n, "en", "Latn")
|
|
152
|
+
fname = RelatonBib::FullName.new(completename: name, initial: initial, surname: surname)
|
|
127
153
|
person = RelatonBib::Person.new(name: fname)
|
|
128
154
|
RelatonBib::ContributionInfo.new(entity: person, role: [{ type: "author" }])
|
|
129
155
|
end
|
|
@@ -145,7 +171,10 @@ module RelatonIetf
|
|
|
145
171
|
#
|
|
146
172
|
def parse_abstract
|
|
147
173
|
@doc.xpath("./xmlns:abstract").map do |c|
|
|
148
|
-
|
|
174
|
+
content = c.xpath("./xmlns:p").map do |p|
|
|
175
|
+
"<#{p.name}>#{p.text.strip}</#{p.name}>"
|
|
176
|
+
end.join
|
|
177
|
+
RelatonBib::FormattedString.new(content: content, language: "en",
|
|
149
178
|
script: "Latn", format: "text/html")
|
|
150
179
|
end
|
|
151
180
|
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.12
|
|
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-01-
|
|
11
|
+
date: 2022-01-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: equivalent-xml
|