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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a30bf20031156fa42620cdc60617bfde448a9ea5404f30839856aa885c16542
4
- data.tar.gz: fa19d27c32808e7856d687bd57a667ca369dffe1bef11b94b55a2be594f98f81
3
+ metadata.gz: 5f782e5e67be5f75336a106dd6e2366aabf9085391d20f0e0e0424d7965e2b7f
4
+ data.tar.gz: 3491eda42b19b30bdbc7568f8a8e436c6d64bfcef80298ff6ca57c50e93737b8
5
5
  SHA512:
6
- metadata.gz: ca37959c346cb6386461c933b802949322c8536325078e4b5a5affaf50db81884b68be273f05d96d788f56ad1fca1521e54328a564d834763f49f66e29f49c9f
7
- data.tar.gz: dc698fc47d0cc3fcf91b848bb6e901d255cf16322600f3f047fc752dcf590686bc3c9d7ac0e089251cae7db4a149ec42e1d3e831322c28e2b8f671f5b65999e9
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-corrigendum recommendation-errata recommendation-annex
6
- focus-group implementers-guide technical-paper technical-report
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)
@@ -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(:itu_pubid) { prefix >> sector >> type? >> code >> sup? >> annex? >> ver? >> date? >> amd? >> any.repeat }
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:, sector:, code:, **args)
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, sector: sector, code: code }
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 = "#{prefix}-#{sector}"
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
@@ -1,3 +1,3 @@
1
1
  module RelatonItu
2
- VERSION = "1.20.0".freeze
2
+ VERSION = "1.20.1".freeze
3
3
  end
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.0
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: 2024-12-13 00:00:00.000000000 Z
11
+ date: 2025-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize