relaton-ietf 1.13.0 → 1.13.2

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: f0ba1d2bd6ef268191965baa72e038c60c672253b27f3c3f762bf98d082c409a
4
- data.tar.gz: ea2cfda5f612cda75fc138776368d53f505e93f3952bb784d40afa7c811296a2
3
+ metadata.gz: 51e29fcf1299a480c0bcd58c49940fa5dff19d860aa433844ae369334df0b53f
4
+ data.tar.gz: dc12d995d535935ec257ae70ba81b5af0e611f4c22a5af02351938e522ead598
5
5
  SHA512:
6
- metadata.gz: 40bc7dd3ee851346775975bf2c4a563b8f6a0cdc6d72fd287c9f8c62c3c27a8314e08180a2a650087ba3db0820223eb9d42a5ae39dbf31c16467b9dc6c6d54b5
7
- data.tar.gz: 0c34cabd945b85d56741a83a73ef0db6334917f208ea0673566e41615b0dfb9a6a3efcf727470e80aa5efcac2210af8fd8fad6725fad849b5d7027c3cf10bb49
6
+ metadata.gz: 967aa4beef15be80301646b2abe549218f2a827bec2bda14d0da7abf24787f0ce91733884d247549a53a623b7f74370724652f6c891b6f55c1a6c865295a2b60
7
+ data.tar.gz: 7e36eaedb2c2e9a2b087156010b0c0097c46f24ba8b4454d9832a42aca004483ce556e3246aaae69cb0560305ac15da0d935669600025ead70c526f8c8ed4a76
@@ -5,7 +5,6 @@ name: rake
5
5
  on:
6
6
  push:
7
7
  branches: [ master, main ]
8
- tags: [ v* ]
9
8
  pull_request:
10
9
 
11
10
  jobs:
@@ -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
- fetched: Date.today.to_s, docid: [docid], relation: rel
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
- entity = RelatonBib::Organization.new(abbrev: n, name: "Internet Architecture Board")
163
- when "IESG"
164
- entity = RelatonBib::Organization.new(abbrev: n, name: "Internet Engineering Steering Group")
165
- when "Internet Engineering Steering Group", "Federal Networking Council", "Internet Architecture Board",
166
- "Internet Activities Board", "Defense Advanced Research Projects Agency", "National Science Foundation",
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(completename: name, initial: initials(int), surname: surname)
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 <description>
207
+ # @param [Nokogiri::XML::Node] contrib contributor
208
+ # @param [String, nil] desc contributor description
203
209
  #
204
- # @return [Array<Hash>] contributors role
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
- [{ type: type }]
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::LocalizedString>]
224
+ # @return [Array<RelatonBib::Forename>]
217
225
  #
218
- def initials(int)
226
+ def forename(int)
219
227
  return [] unless int
220
228
 
221
- int.split(/(?<=\.)-?\s?|\s/).map { |i| RelatonBib::LocalizedString.new i, "en", "Latn" }
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
  #
@@ -37,7 +37,6 @@ module RelatonIetf
37
37
  #
38
38
  def parse # rubocop:disable Metrics/MethodLength
39
39
  IetfBibliographicItem.new(
40
- fetched: Date.today.to_s,
41
40
  title: make_title,
42
41
  docnumber: docnumber,
43
42
  type: "standard",
@@ -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
- IetfBibliographicItem.from_hash YAML.safe_load(resp) if resp
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]
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "1.13.0".freeze
2
+ VERSION = "1.13.2".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.13.0
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-08-21 00:00:00.000000000 Z
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"