relaton-ietf 1.13.2 → 1.13.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51e29fcf1299a480c0bcd58c49940fa5dff19d860aa433844ae369334df0b53f
4
- data.tar.gz: dc12d995d535935ec257ae70ba81b5af0e611f4c22a5af02351938e522ead598
3
+ metadata.gz: 6fe51d3e7f18e3e3b6c093ee78a24c917cdfd95d88bab7035078c8627a35f0fb
4
+ data.tar.gz: 29b83fa09d9a1b403fdeef78ef77297b8911d7ab222a2b4cf47a60ffd5b7a8d6
5
5
  SHA512:
6
- metadata.gz: 967aa4beef15be80301646b2abe549218f2a827bec2bda14d0da7abf24787f0ce91733884d247549a53a623b7f74370724652f6c891b6f55c1a6c865295a2b60
7
- data.tar.gz: 7e36eaedb2c2e9a2b087156010b0c0097c46f24ba8b4454d9832a42aca004483ce556e3246aaae69cb0560305ac15da0d935669600025ead70c526f8c8ed4a76
6
+ metadata.gz: 98e68d59cc3b1c53c6c3ed3a845a05b9f2f2ceca3a60b6f63bb952fc51dcf81cfe8ebe7e62e9fbfaadd30a2268ded0dbf1c947e6c6c3f17e91bf76bd0feb4a70
7
+ data.tar.gz: ccf02324637a7da4cb8b960c5ed05363e399dd4da11578f50254dc783662aa82b4da87b4ca031bd8cc9de9c5500bc41741d98e9c63314e29771bd1ef7a62be2c
@@ -3,6 +3,25 @@ module RelatonIetf
3
3
  include RelatonBib::BibXMLParser
4
4
  extend BibXMLParser
5
5
 
6
+ FULLNAMEORG = [
7
+ "IAB", "Internet Architecture Board", "IAB and IESG", "IESG",
8
+ "IAB Advisory Committee", "Internet Engineering Steering Group",
9
+ "Network Information Center. Stanford Research Institute",
10
+ "Information Sciences Institute University of Southern California",
11
+ "International Telegraph and Telephone Consultative Committee of the International Telecommunication Union",
12
+ "National Bureau of Standards", "International Organization for Standardization",
13
+ "National Research Council", "Gateway Algorithms and Data Structures Task Force",
14
+ "National Science Foundation", "Network Technical Advisory Group",
15
+ "NetBIOS Working Group in the Defense Advanced Research Projects Agency",
16
+ "Internet Activities Board", "End-to-End Services Task Force",
17
+ "Defense Advanced Research Projects Agency", "The North American Directory Forum",
18
+ "ESCC X.500/X.400 Task Force", "ESnet Site Coordinating Comittee (ESCC)",
19
+ "Energy Sciences Network (ESnet)", "RARE WG-MSG Task Force 88",
20
+ "Internet Assigned Numbers Authority (IANA)", "Federal Networking Council",
21
+ "Audio-Video Transport Working Group", "KOI8-U Working Group",
22
+ "The Internet Society", "Sun Microsystems"
23
+ ].freeze
24
+
6
25
  # @param attrs [Hash]
7
26
  # @return [RelatonIetf::IetfBibliographicItem]
8
27
  def bib_item(**attrs)
@@ -46,7 +65,40 @@ module RelatonIetf
46
65
  }
47
66
  end
48
67
  contribs + super
49
- # persons(reference) + organizations(reference)
68
+ end
69
+
70
+ #
71
+ # Overrade RelatonBib::BibXMLParser#full_name method
72
+ #
73
+ # @param author [Nokogiri::XML::Element]
74
+ # @param reference [Nokogiri::XML::Element]
75
+ #
76
+ # @return [RelatonBib::FullName]
77
+ #
78
+ def full_name(author, reference)
79
+ lang = language reference
80
+ sname, inits = parse_surname_initials author
81
+ initials = localized_string(inits, lang)
82
+ RelatonBib::FullName.new(
83
+ completename: localized_string(author[:fullname], lang),
84
+ initials: initials, forename: forename(inits, lang),
85
+ surname: localized_string(sname, lang)
86
+ )
87
+ end
88
+
89
+ def parse_surname_initials(author)
90
+ regex = /(?:[A-Z]{1,2}(?:\.[\s-]?|\s))+/
91
+ surname = author[:surname] || author[:fullname].sub(regex, "").strip
92
+ inits = author[:initials] || regex.match(author[:fullname])&.to_s&.strip
93
+ [surname, inits]
94
+ end
95
+
96
+ def parse_surname(fullname)
97
+ fullname.sub(/(?:[A-Z]{1,2}(?:\.[\s-]?|\s))+/, "").strip
98
+ end
99
+
100
+ def parse_initials(fullname)
101
+ fullname.match(/(?:[A-Z]{1,2}(?:\.[\s-]?|\s))+/).to_s.strip
50
102
  end
51
103
  end
52
104
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "1.13.2".freeze
2
+ VERSION = "1.13.3".freeze
3
3
  end
data/relaton_ietf.gemspec CHANGED
@@ -38,5 +38,5 @@ Gem::Specification.new do |spec|
38
38
  spec.add_development_dependency "vcr"
39
39
  spec.add_development_dependency "webmock"
40
40
 
41
- spec.add_dependency "relaton-bib", "~> 1.13.0"
41
+ spec.add_dependency "relaton-bib", "~> 1.13.10"
42
42
  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.2
4
+ version: 1.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-20 00:00:00.000000000 Z
11
+ date: 2022-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.13.0
131
+ version: 1.13.10
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 1.13.0
138
+ version: 1.13.10
139
139
  description: "RelatonIetf: retrieve IETF Standards for bibliographic use \nusing the
140
140
  BibliographicItem model.\n\nFormerly known as rfcbib.\n"
141
141
  email:
@@ -181,7 +181,7 @@ homepage: https://github.com/metanorma/relaton-ietf
181
181
  licenses:
182
182
  - BSD-2-Clause
183
183
  metadata: {}
184
- post_install_message:
184
+ post_install_message:
185
185
  rdoc_options: []
186
186
  require_paths:
187
187
  - lib
@@ -196,8 +196,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  - !ruby/object:Gem::Version
197
197
  version: '0'
198
198
  requirements: []
199
- rubygems_version: 3.2.3
200
- signing_key:
199
+ rubygems_version: 3.1.6
200
+ signing_key:
201
201
  specification_version: 4
202
202
  summary: 'RelatonIetf: retrieve IETF Standards for bibliographic use using the BibliographicItem
203
203
  model'