relaton-itu 1.20.0 → 1.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f782e5e67be5f75336a106dd6e2366aabf9085391d20f0e0e0424d7965e2b7f
|
4
|
+
data.tar.gz: 3491eda42b19b30bdbc7568f8a8e436c6d64bfcef80298ff6ca57c50e93737b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48987e9207d2a28778de5442e53ac2cba35481a219791aba02f119ed2048ec3018effffbea90d825cb3702c4e3c04285e649264542a6686163d046e52a528957
|
7
|
+
data.tar.gz: 2ece9eb73b4dbdb478d2c54d635c76cd8b11f54a59357aed2a8227a7fb69a5cb5d5cf7eaefcb4b0fa6a907fb93b95afcf80e0b950e44d533fb86456cc7db9bda
|
@@ -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
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.1
|
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-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|