relaton-ietf 1.13.0 → 1.13.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/rake.yml +0 -1
- data/.github/workflows/release.yml +22 -0
- data/lib/relaton_ietf/bibxml_parser.rb +1 -1
- data/lib/relaton_ietf/data_fetcher.rb +1 -1
- data/lib/relaton_ietf/rfc_entry.rb +27 -17
- data/lib/relaton_ietf/rfc_index_entry.rb +0 -1
- data/lib/relaton_ietf/scrapper.rb +5 -1
- data/lib/relaton_ietf/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51e29fcf1299a480c0bcd58c49940fa5dff19d860aa433844ae369334df0b53f
|
4
|
+
data.tar.gz: dc12d995d535935ec257ae70ba81b5af0e611f4c22a5af02351938e522ead598
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 967aa4beef15be80301646b2abe549218f2a827bec2bda14d0da7abf24787f0ce91733884d247549a53a623b7f74370724652f6c891b6f55c1a6c865295a2b60
|
7
|
+
data.tar.gz: 7e36eaedb2c2e9a2b087156010b0c0097c46f24ba8b4454d9832a42aca004483ce556e3246aaae69cb0560305ac15da0d935669600025ead70c526f8c8ed4a76
|
data/.github/workflows/rake.yml
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: release
|
4
|
+
|
5
|
+
on:
|
6
|
+
workflow_dispatch:
|
7
|
+
inputs:
|
8
|
+
next_version:
|
9
|
+
description: |
|
10
|
+
Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
|
11
|
+
required: true
|
12
|
+
default: 'skip'
|
13
|
+
push:
|
14
|
+
tags: [ v* ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
release:
|
18
|
+
uses: relaton/support/.github/workflows/release.yml@master
|
19
|
+
with:
|
20
|
+
next_version: ${{ github.event.inputs.next_version }}
|
21
|
+
secrets:
|
22
|
+
rubygems-api-key: ${{ secrets.RELATON_CI_RUBYGEMS_API_KEY }}
|
@@ -7,7 +7,7 @@ module RelatonIetf
|
|
7
7
|
# @return [RelatonIetf::IetfBibliographicItem]
|
8
8
|
def bib_item(**attrs)
|
9
9
|
unless attrs.delete(:is_relation)
|
10
|
-
attrs[:fetched] = Date.today.to_s
|
10
|
+
# attrs[:fetched] = Date.today.to_s
|
11
11
|
# attrs[:place] = ["Fremont, CA"]
|
12
12
|
end
|
13
13
|
RelatonIetf::IetfBibliographicItem.new(**attrs)
|
@@ -122,7 +122,7 @@ module RelatonIetf
|
|
122
122
|
last_v = HashConverter.hash_to_bib YAML.load_file("#{@output}/#{vs.last}.#{@ext}")
|
123
123
|
bib = IetfBibliographicItem.new(
|
124
124
|
title: last_v[:title], abstract: last_v[:abstract], formattedref: fref,
|
125
|
-
|
125
|
+
docid: [docid], relation: rel
|
126
126
|
)
|
127
127
|
save_doc bib
|
128
128
|
end
|
@@ -30,7 +30,6 @@ module RelatonIetf
|
|
30
30
|
type: "standard",
|
31
31
|
language: ["en"],
|
32
32
|
script: ["Latn"],
|
33
|
-
fetched: Date.today.to_s,
|
34
33
|
docid: parse_docid,
|
35
34
|
docnumber: code,
|
36
35
|
title: parse_title,
|
@@ -150,7 +149,7 @@ module RelatonIetf
|
|
150
149
|
#
|
151
150
|
# @return [Array<RelatonBib::ContributionInfo>] document contributors
|
152
151
|
#
|
153
|
-
def parse_contributor # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity
|
152
|
+
def parse_contributor # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
154
153
|
@doc.xpath("./xmlns:author").map do |contrib| # rubocop:disable Metrics/BlockLength
|
155
154
|
n = contrib.at("./xmlns:name").text
|
156
155
|
case n
|
@@ -158,12 +157,16 @@ module RelatonIetf
|
|
158
157
|
entity = RelatonBib::Organization.new(abbrev: n, name: "International Organization for Standardization")
|
159
158
|
when "International Organization for Standardization"
|
160
159
|
entity = RelatonBib::Organization.new(abbrev: "ISO", name: n)
|
161
|
-
when "IAB"
|
162
|
-
|
163
|
-
when "
|
164
|
-
|
165
|
-
|
166
|
-
|
160
|
+
# when "IAB", "IESG", "Internet Architecture Board", "IAB and IESG",
|
161
|
+
# "IAB Advisory Committee", "Internet Engineering Steering Group"
|
162
|
+
when /#{RelatonBib::BibXMLParser::FULLNAMEORG.join("|")}/
|
163
|
+
abbr = n.upcase == n ? n : n.split.reduce([]) { |a, w| w == w.upcase ? break : a << w[0] }&.join
|
164
|
+
entity = RelatonBib::Organization.new(abbrev: abbr, name: n)
|
165
|
+
desc = "BibXML author"
|
166
|
+
# when "IESG"
|
167
|
+
# entity = RelatonBib::Organization.new(abbrev: n, name: "Internet Engineering Steering Group")
|
168
|
+
when "Federal Networking Council", "Internet Activities Board",
|
169
|
+
"Defense Advanced Research Projects Agency", "National Science Foundation",
|
167
170
|
"National Research Council", "National Bureau of Standards"
|
168
171
|
abbr = n.split.map { |w| w[0] if w[0] == w[0].upcase }.join
|
169
172
|
entity = RelatonBib::Organization.new(abbrev: abbr, name: n)
|
@@ -189,23 +192,28 @@ module RelatonIetf
|
|
189
192
|
/^(?:(?<int>(?:\p{Lu}+(?:-\w|\(\w\))?\.{0,2}[-\s]?)+)\s)?(?<snm>[[:alnum:]\s'-.]+)$/ =~ n
|
190
193
|
surname = RelatonBib::LocalizedString.new(snm, "en", "Latn")
|
191
194
|
name = RelatonBib::LocalizedString.new(n, "en", "Latn")
|
192
|
-
fname = RelatonBib::FullName.new(
|
195
|
+
fname = RelatonBib::FullName.new(
|
196
|
+
completename: name, initials: int, forename: forename(int), surname: surname,
|
197
|
+
)
|
193
198
|
entity = RelatonBib::Person.new(name: fname)
|
194
199
|
end
|
195
|
-
RelatonBib::ContributionInfo.new(entity: entity, role: parse_role(contrib))
|
200
|
+
RelatonBib::ContributionInfo.new(entity: entity, role: parse_role(contrib, desc))
|
196
201
|
end
|
197
202
|
end
|
198
203
|
|
199
204
|
#
|
200
205
|
# Parse contributors role
|
201
206
|
#
|
202
|
-
# @param [Nokogiri::XML::Node] contrib
|
207
|
+
# @param [Nokogiri::XML::Node] contrib contributor
|
208
|
+
# @param [String, nil] desc contributor description
|
203
209
|
#
|
204
|
-
# @return [Array<Hash>]
|
210
|
+
# @return [Array<Hash>] contributor's role
|
205
211
|
#
|
206
|
-
def parse_role(contrib)
|
212
|
+
def parse_role(contrib, desc = nil)
|
207
213
|
type = contrib.at("./xmlns:title")&.text&.downcase || "author"
|
208
|
-
|
214
|
+
role = { type: type }
|
215
|
+
role[:description] = [desc] if desc
|
216
|
+
[role]
|
209
217
|
end
|
210
218
|
|
211
219
|
#
|
@@ -213,12 +221,14 @@ module RelatonIetf
|
|
213
221
|
#
|
214
222
|
# @param [String] int
|
215
223
|
#
|
216
|
-
# @return [Array<RelatonBib::
|
224
|
+
# @return [Array<RelatonBib::Forename>]
|
217
225
|
#
|
218
|
-
def
|
226
|
+
def forename(int)
|
219
227
|
return [] unless int
|
220
228
|
|
221
|
-
int.split(
|
229
|
+
int.split(/\.-?\s?|\s/).map do |i|
|
230
|
+
RelatonBib::Forename.new initial: i, language: "en", script: "Latn"
|
231
|
+
end
|
222
232
|
end
|
223
233
|
|
224
234
|
#
|
@@ -39,7 +39,11 @@ module RelatonIetf
|
|
39
39
|
uri = "#{ghurl}#{ref.sub(/\s|\u00a0/, '.')}.yaml"
|
40
40
|
# BibXMLParser.parse get_page(uri), is_relation: is_relation, ver: ver
|
41
41
|
resp = get_page uri
|
42
|
-
|
42
|
+
return unless resp
|
43
|
+
|
44
|
+
hash = YAML.safe_load resp
|
45
|
+
hash["fetched"] = Date.today.to_s
|
46
|
+
IetfBibliographicItem.from_hash hash
|
43
47
|
end
|
44
48
|
|
45
49
|
# @param uri [String]
|
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.13.
|
4
|
+
version: 1.13.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: 2022-
|
11
|
+
date: 2022-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -145,6 +145,7 @@ extensions: []
|
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
147
|
- ".github/workflows/rake.yml"
|
148
|
+
- ".github/workflows/release.yml"
|
148
149
|
- ".gitignore"
|
149
150
|
- ".hound.yml"
|
150
151
|
- ".rspec"
|