relaton-ietf 1.9.12 → 1.9.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c189b76c5cd1565d79d2b910449c708bd759419e38fafd7cc8a96d0bfc2eab9a
4
- data.tar.gz: cefad1d99e228226e1ac6ac5fdaf627911006a1e67d8ed93babb108150f4631b
3
+ metadata.gz: 7b66f8a6c856c44ac8b16ab20f9efe24f1c87e3087afd02870938e38cf28d76a
4
+ data.tar.gz: 8ea240983edf3b80fec6de69de1845d80e318fbd12a724e13d56c6b7901c2deb
5
5
  SHA512:
6
- metadata.gz: fec8da43d98eadd06a4e511399fee9832dccbd4783a69268bd4762901270051c4eb275b8c91b9da3d9360fe86ba740e488d263cd697884f144a3749dfc6e26bf
7
- data.tar.gz: 4a7c370e2e1825df2474be9796855f024aed008c30f737e087abb0bf8b02aed03d1332221c3eb8f71a7a3d51913eee215c1b77c21e6848ab01731e77fa8b5da6
6
+ metadata.gz: aaed3229833cb24cc7694ee1ac5d817097905c1e520ff8e24e15fbb43ef615548eafb646e992f255cbb7492319ceae139457df8992e143b1ca5c248bb8d6982d
7
+ data.tar.gz: '08b765ebc09ff7c328f4c8059a33acb559e6e1ebb0bdcd7911ea2d71a8bcece6ef5d0ffbee6120876940a1df04a93a5e67a9ad6edf83305588c4955e7ba66309'
@@ -83,6 +83,9 @@ module RelatonIetf
83
83
  def fetch_ieft_rfcs
84
84
  rfc_index.xpath("xmlns:rfc-entry").each do |doc|
85
85
  save_doc RfcEntry.parse(doc)
86
+ rescue StandardError => e
87
+ warn "Error parsing #{doc.at('./xmlns:doc-id').text}: #{e.message}"
88
+ warn e.backtrace[0..5].join("\n")
86
89
  end
87
90
  end
88
91
 
@@ -142,19 +142,66 @@ module RelatonIetf
142
142
  #
143
143
  # @return [Array<RelatonBib::ContributionInfo>] document contributors
144
144
  #
145
- def parse_contributor
146
- @doc.xpath("./xmlns:author").map do |contributor|
145
+ def parse_contributor # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity
146
+ @doc.xpath("./xmlns:author").map do |contributor| # rubocop:disable Metrics/BlockLength
147
147
  n = contributor.at("./xmlns:name").text
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)
153
- person = RelatonBib::Person.new(name: fname)
154
- RelatonBib::ContributionInfo.new(entity: person, role: [{ type: "author" }])
148
+ case n
149
+ when "ISO"
150
+ entity = RelatonBib::Organization.new(abbrev: n, name: "International Organization for Standardization")
151
+ when "International Organization for Standardization"
152
+ entity = RelatonBib::Organization.new(abbrev: "ISO", name: n)
153
+ when "IAB"
154
+ entity = RelatonBib::Organization.new(abbrev: n, name: "Internet Architecture Board")
155
+ when "IESG"
156
+ entity = RelatonBib::Organization.new(abbrev: n, name: "Internet Engineering Steering Group")
157
+ when "Internet Engineering Steering Group", "Federal Networking Council", "Internet Architecture Board",
158
+ "Internet Activities Board", "Defense Advanced Research Projects Agency", "National Science Foundation",
159
+ "National Research Council", "National Bureau of Standards"
160
+ abbr = n.split.map { |w| w[0] if w[0] == w[0].upcase }.join
161
+ entity = RelatonBib::Organization.new(abbrev: abbr, name: n)
162
+ when "IETF Secretariat"
163
+ entity = RelatonBib::Organization.new(abbrev: "IETF", name: n)
164
+ when "Audio-Video Transport Working Group", /North American Directory Forum/, "EARN Staff",
165
+ "Vietnamese Standardization Working Group", "ACM SIGUCCS", "ESCC X.500/X.400 Task Force",
166
+ "Sun Microsystems", "NetBIOS Working Group in the Defense Advanced Research Projects Agency",
167
+ "End-to-End Services Task Force", "Network Technical Advisory Group", "Bolt Beranek",
168
+ "Newman Laboratories", "Gateway Algorithms and Data Structures Task Force",
169
+ "Network Information Center. Stanford Research Institute", "RFC Editor",
170
+ "Information Sciences Institute University of Southern California"
171
+ entity = RelatonBib::Organization.new(name: n)
172
+ when "Internet Assigned Numbers Authority (IANA)"
173
+ entity = RelatonBib::Organization.new(abbrev: "IANA", name: "Internet Assigned Numbers Authority")
174
+ when "ESnet Site Coordinating Comittee (ESCC)"
175
+ entity = RelatonBib::Organization.new(abbrev: "ESCC", name: "ESnet Site Coordinating Comittee")
176
+ when "Energy Sciences Network (ESnet)"
177
+ entity = RelatonBib::Organization.new(abbrev: "ESnet", name: "Energy Sciences Network")
178
+ when "International Telegraph and Telephone Consultative Committee of the International Telecommunication Union"
179
+ entity = RelatonBib::Organization.new(abbrev: "CCITT", name: n)
180
+ else
181
+ # int, snm = n.split
182
+ /^(?:(?<int>(?:\p{Lu}+(?:-\w|\(\w\))?\.{0,2}[-\s]?)+)\s)?(?<snm>[[:alnum:]\s'-.]+)$/ =~ n
183
+ surname = RelatonBib::LocalizedString.new(snm, "en", "Latn")
184
+ name = RelatonBib::LocalizedString.new(n, "en", "Latn")
185
+ fname = RelatonBib::FullName.new(completename: name, initial: initials(int), surname: surname)
186
+ entity = RelatonBib::Person.new(name: fname)
187
+ end
188
+ RelatonBib::ContributionInfo.new(entity: entity, role: [{ type: "author" }])
155
189
  end
156
190
  end
157
191
 
192
+ #
193
+ # Ctreat initials
194
+ #
195
+ # @param [String] int
196
+ #
197
+ # @return [Array<RelatonBib::LocalizedString>]
198
+ #
199
+ def initials(int)
200
+ return [] unless int
201
+
202
+ int.split(/\.-?\s?|\s/).map { |i| RelatonBib::LocalizedString.new i, "en", "Latn" }
203
+ end
204
+
158
205
  #
159
206
  # Parse document keywords
160
207
  #
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "1.9.12".freeze
2
+ VERSION = "1.9.13".freeze
3
3
  end
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.12
4
+ version: 1.9.13
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-21 00:00:00.000000000 Z
11
+ date: 2022-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml