relaton-itu 1.20.0 → 1.20.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 +4 -4
- data/Gemfile +4 -0
- data/lib/relaton_itu/document_type.rb +3 -4
- data/lib/relaton_itu/pubid.rb +9 -5
- data/lib/relaton_itu/version.rb +1 -1
- data/lib/relaton_itu/xml_parser.rb +2 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17a791929b754f96d871d876154a933d2c2f318cbe09da51a4a94b4c5d9c8262
|
4
|
+
data.tar.gz: 407933d5de7be59b6db6af3b70cd3dc6b82cb0194fc5c457b6dd55fb23467191
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4ecb485408a423a9909be4ef09c6b405a883628c3b16c1aa85447ecf2d0e1e71cadb683f795d0ff261f614b62afe2483661236ff734f67fb804d327a202bc7e
|
7
|
+
data.tar.gz: e90a2ef02d06283247baee88ba27284d9cc763785bf24486591c5605e69b7fb99477cbeeb800895e0264c69bdffb21bd73352bedafa6694a3fd79dd1f6943f78
|
data/Gemfile
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
module RelatonItu
|
2
2
|
class DocumentType < RelatonBib::DocumentType
|
3
3
|
TYPES = %w[
|
4
|
-
recommendation recommendation-supplement recommendation-amendment
|
5
|
-
recommendation-
|
6
|
-
|
7
|
-
joint-itu-iso-iec resolution service-publication handbook question
|
4
|
+
recommendation recommendation-supplement recommendation-amendment recommendation-corrigendum
|
5
|
+
recommendation-errata recommendation-annex focus-group implementers-guide technical-paper
|
6
|
+
technical-report joint-itu-iso-iec resolution service-publication handbook question contribution
|
8
7
|
].freeze
|
9
8
|
|
10
9
|
def initialize(type:, abbreviation: nil)
|
data/lib/relaton_itu/pubid.rb
CHANGED
@@ -38,7 +38,9 @@ module RelatonItu
|
|
38
38
|
rule(:ver) { space >> str("(V") >> num.repeat(1, 2).as(:version) >> str(")") }
|
39
39
|
rule(:ver?) { ver.maybe }
|
40
40
|
|
41
|
-
rule(:
|
41
|
+
rule(:itu_pubid_sector) { prefix >> sector >> type? >> code >> sup? >> annex? >> ver? >> date? >> amd? >> any.repeat }
|
42
|
+
rule(:itu_pubid_no_sector) { prefix >> type? >> code >> sup? >> annex? >> ver? >> date? >> amd? >> any.repeat }
|
43
|
+
rule(:itu_pubid) { itu_pubid_sector | itu_pubid_no_sector }
|
42
44
|
root(:itu_pubid)
|
43
45
|
end
|
44
46
|
|
@@ -59,9 +61,9 @@ module RelatonItu
|
|
59
61
|
# @param [String, nil] amd amendment number
|
60
62
|
# @param [String, nil] amd_date amendment
|
61
63
|
#
|
62
|
-
def initialize(prefix:,
|
64
|
+
def initialize(prefix:, code:, **args)
|
63
65
|
@prefix = prefix
|
64
|
-
@sector = sector
|
66
|
+
@sector = args[:sector]
|
65
67
|
@type = args[:type]
|
66
68
|
@day = args[:day]
|
67
69
|
@code, year, month = date_from_code code
|
@@ -84,7 +86,8 @@ module RelatonItu
|
|
84
86
|
end
|
85
87
|
|
86
88
|
def to_h(with_type: true) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
87
|
-
hash = { prefix: prefix,
|
89
|
+
hash = { prefix: prefix, code: code }
|
90
|
+
hash[:sector] = sector if sector
|
88
91
|
hash[:type] = type if type && with_type
|
89
92
|
hash[:suppl] = suppl if suppl
|
90
93
|
hash[:annex] = annex if annex
|
@@ -102,7 +105,8 @@ module RelatonItu
|
|
102
105
|
end
|
103
106
|
|
104
107
|
def to_s(ref: false) # rubocop:disable Metrics/AbcSize
|
105
|
-
s =
|
108
|
+
s = prefix.dup
|
109
|
+
s << "-#{sector}" if sector
|
106
110
|
s << " #{type}" if type && !ref
|
107
111
|
s << " #{code}"
|
108
112
|
s << " Suppl. #{suppl}" if suppl
|
data/lib/relaton_itu/version.rb
CHANGED
@@ -14,8 +14,7 @@ module RelatonItu
|
|
14
14
|
# @param ext [Nokogiri::XML::Element]
|
15
15
|
# @return [RelatonItu::EditorialGroup]
|
16
16
|
def fetch_editorialgroup(ext)
|
17
|
-
eg = ext.at
|
18
|
-
return unless eg
|
17
|
+
return unless ext && (eg = ext.at "editorialgroup")
|
19
18
|
|
20
19
|
EditorialGroup.new(
|
21
20
|
bureau: eg.at("bureau")&.text,
|
@@ -51,8 +50,7 @@ module RelatonItu
|
|
51
50
|
# @param ext [Nokogiri::XML::Element]
|
52
51
|
# @return [RelatonItu::StructuredIdentifier]
|
53
52
|
def fetch_structuredidentifier(ext)
|
54
|
-
sid = ext.at "./structuredidentifier"
|
55
|
-
return unless sid
|
53
|
+
return unless ext && (sid = ext.at "./structuredidentifier")
|
56
54
|
|
57
55
|
br = sid.at("bureau").text
|
58
56
|
dn = sid.at("docnumber").text
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-itu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.20.
|
4
|
+
version: 1.20.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:
|
11
|
+
date: 2025-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.5.22
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: 'RelatonItu: retrieve ITU Standards for bibliographic use using the BibliographicItem
|