pubid-itu 0.0.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 +7 -0
- data/LICENSE.txt +25 -0
- data/README.adoc +26 -0
- data/lib/pubid/itu/configuration.rb +5 -0
- data/lib/pubid/itu/errors.rb +4 -0
- data/lib/pubid/itu/identifier/addendum.rb +11 -0
- data/lib/pubid/itu/identifier/amendment.rb +11 -0
- data/lib/pubid/itu/identifier/annex.rb +11 -0
- data/lib/pubid/itu/identifier/appendix.rb +11 -0
- data/lib/pubid/itu/identifier/base.rb +84 -0
- data/lib/pubid/itu/identifier/corrigendum.rb +11 -0
- data/lib/pubid/itu/identifier/implementers_guide.rb +15 -0
- data/lib/pubid/itu/identifier/question.rb +11 -0
- data/lib/pubid/itu/identifier/recommendation.rb +16 -0
- data/lib/pubid/itu/identifier/regulatory_publication.rb +11 -0
- data/lib/pubid/itu/identifier/resolution.rb +11 -0
- data/lib/pubid/itu/identifier/special_publication.rb +11 -0
- data/lib/pubid/itu/identifier/supplement.rb +24 -0
- data/lib/pubid/itu/identifier.rb +32 -0
- data/lib/pubid/itu/parser.rb +113 -0
- data/lib/pubid/itu/renderer/base.rb +89 -0
- data/lib/pubid/itu/renderer/implementers_guide.rb +15 -0
- data/lib/pubid/itu/transformer.rb +7 -0
- data/lib/pubid/itu/version.rb +5 -0
- data/lib/pubid/itu.rb +52 -0
- data/lib/pubid-itu.rb +3 -0
- data/series.yaml +42 -0
- metadata +127 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e58bdfc3dfd515cee9b035547d9ff312cb041cb4727e7e7c24ae01e00e402e6d
|
4
|
+
data.tar.gz: 6c9d1e56475ff4d4a8b8e9c4c63ed0b3b6f1af3005078f41cdd9bc0b9a4af242
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 498dd3e32987d40016f5e4ddc49a6ea1cd989de340b45c52698afb2d9433dc3fc6f20ad60bc4ab306944654e56b7381e5709a29248ab59bc8beea97318858411
|
7
|
+
data.tar.gz: 30b6fc8004527edf7b95f6ba42704ccdaff6beeef9847c6da395bfa62dfc7a86f9ebcbbbfc009d50034d4d6271c800d4699cb128922d4afe1b2f5be108fad52c
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
BSD 2-Clause License
|
2
|
+
|
3
|
+
Copyright (c) 2018, Ribose
|
4
|
+
All rights reserved.
|
5
|
+
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
10
|
+
list of conditions and the following disclaimer.
|
11
|
+
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
14
|
+
and/or other materials provided with the distribution.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.adoc
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
= JIS publication identifiers ("ITU PubID")
|
2
|
+
|
3
|
+
== Purpose
|
4
|
+
|
5
|
+
This gem implements a mechanism to parse and utilize ITU publication
|
6
|
+
identifiers.
|
7
|
+
|
8
|
+
== Use cases to support
|
9
|
+
|
10
|
+
. generate updated PubID
|
11
|
+
|
12
|
+
== Usage
|
13
|
+
|
14
|
+
=== Identifier creation
|
15
|
+
|
16
|
+
Basic usage of the pubid-itu gem starts with the `Identifier#create` method.
|
17
|
+
|
18
|
+
[source,ruby]
|
19
|
+
----
|
20
|
+
require "pubid-itu"
|
21
|
+
|
22
|
+
pubid = Pubid::Itu::Identifier.create(number: 1234, sector: "R", series: "V",part: 1)
|
23
|
+
pubid.to_s
|
24
|
+
|
25
|
+
=> "ITU-R V.1234-1"
|
26
|
+
----
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
module Pubid::Itu
|
4
|
+
module Identifier
|
5
|
+
class Base < Pubid::Core::Identifier::Base
|
6
|
+
attr_accessor :series, :sector, :date, :amendment, :subseries,
|
7
|
+
:second_number, :annex, :range
|
8
|
+
|
9
|
+
extend Forwardable
|
10
|
+
|
11
|
+
def self.type
|
12
|
+
{ key: :itu, title: "International Communication Union" }
|
13
|
+
end
|
14
|
+
|
15
|
+
# @param month [Integer] document's month
|
16
|
+
# @param edition [String] document's edition version, e.g. "3.0", "1.0"
|
17
|
+
def initialize(publisher: "ITU", series: nil, sector: nil, part: nil,
|
18
|
+
date: nil, amendment: nil, subseries: nil, number: nil,
|
19
|
+
second_number: nil, annex: nil, range: nil, **opts)
|
20
|
+
|
21
|
+
super(**opts.merge(publisher: publisher, number: number))
|
22
|
+
@series = series
|
23
|
+
@sector = sector
|
24
|
+
@part = part if part
|
25
|
+
@date = date
|
26
|
+
@amendment = amendment
|
27
|
+
@subseries = subseries
|
28
|
+
@second_number = second_number
|
29
|
+
@annex = annex
|
30
|
+
@range = range
|
31
|
+
end
|
32
|
+
|
33
|
+
def to_s(**opts)
|
34
|
+
self.class.get_renderer_class.new(get_params).render(**opts)
|
35
|
+
end
|
36
|
+
|
37
|
+
class << self
|
38
|
+
# returns true when type matching current class type
|
39
|
+
def has_type?(type)
|
40
|
+
return type == self.type[:key] if type.is_a?(Symbol)
|
41
|
+
|
42
|
+
if self.type.key?(:short)
|
43
|
+
self.type[:short].is_a?(Array) ? self.type[:short].include?(type) : self.type[:short] == type
|
44
|
+
else
|
45
|
+
type.to_s.downcase.to_sym == self.type[:key]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def transform_supplements(type, identifier_params)
|
50
|
+
Identifier.create(
|
51
|
+
type: type,
|
52
|
+
base: transform(
|
53
|
+
**identifier_params.dup.tap { |h| h.delete(type) }),
|
54
|
+
**identifier_params[type],
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Use Identifier#create to resolve identifier's type class
|
59
|
+
def transform(params)
|
60
|
+
identifier_params = params.map do |k, v|
|
61
|
+
get_transformer_class.new.apply(k => v)
|
62
|
+
end.inject({}, :merge)
|
63
|
+
|
64
|
+
%i(supplement amendment corrigendum annex addendum appendix).each do |type|
|
65
|
+
return transform_supplements(type, identifier_params) if identifier_params[type]
|
66
|
+
end
|
67
|
+
Identifier.create(**identifier_params)
|
68
|
+
end
|
69
|
+
|
70
|
+
def get_parser_class
|
71
|
+
Parser
|
72
|
+
end
|
73
|
+
|
74
|
+
def get_renderer_class
|
75
|
+
Renderer::Base
|
76
|
+
end
|
77
|
+
|
78
|
+
def get_transformer_class
|
79
|
+
Transformer
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Pubid::Itu
|
2
|
+
module Identifier
|
3
|
+
class ImplementersGuide < Base
|
4
|
+
def_delegators 'Pubid::Itu::Identifier::ImplementersGuide', :type
|
5
|
+
|
6
|
+
def self.type
|
7
|
+
{ key: :imp, title: "Implementer's Guide" }
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.get_renderer_class
|
11
|
+
Renderer::ImplementersGuide
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Pubid::Itu
|
2
|
+
module Identifier
|
3
|
+
class Recommendation < Base
|
4
|
+
def_delegators 'Pubid::Itu::Identifier::Recommendation', :type
|
5
|
+
|
6
|
+
def initialize(**opts)
|
7
|
+
# add type when Recommendation is default type
|
8
|
+
super(**opts.merge(type: "REC"))
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.type
|
12
|
+
{ key: :recommendation, title: "Recommendation", short: "REC" }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Pubid::Itu
|
2
|
+
module Identifier
|
3
|
+
class Supplement < Base
|
4
|
+
def_delegators 'Pubid::Itu::Identifier::Supplement', :type
|
5
|
+
|
6
|
+
attr_accessor :base
|
7
|
+
|
8
|
+
def initialize(base: nil, **opts)
|
9
|
+
super(**opts)
|
10
|
+
@base = base
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_params
|
14
|
+
# XXX: hack to render supplements using Base renderer, because we need to
|
15
|
+
# place date published after amendment, e.g. `ITU-T G.780/Y.1351 Amd 1 (2004)`
|
16
|
+
@base.get_params.merge(self.type[:key] => super)
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.type
|
20
|
+
{ key: :supplement, title: "Supplement" }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Pubid::Itu
|
2
|
+
module Identifier
|
3
|
+
class << self
|
4
|
+
include Pubid::Core::Identifier
|
5
|
+
|
6
|
+
# @see Pubid::Identifier::Base.parse
|
7
|
+
def parse(*args)
|
8
|
+
Base.parse(*args)
|
9
|
+
end
|
10
|
+
|
11
|
+
def resolve_identifier(parameters = {})
|
12
|
+
return Question.new(**parameters) if parameters[:series].to_s.match?(/^SG/)
|
13
|
+
|
14
|
+
return Resolution.new(**parameters) if parameters[:series].to_s == "R"
|
15
|
+
|
16
|
+
return SpecialPublication.new(**parameters) if parameters[:series].to_s == "OB"
|
17
|
+
|
18
|
+
if parameters[:regulatory_publication]
|
19
|
+
return RegulatoryPublication.new(
|
20
|
+
**parameters.reject { |k, _| k == :regulatory_publication }.merge(
|
21
|
+
{ series: parameters[:regulatory_publication] },
|
22
|
+
),
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
return Recommendation.new(**parameters) if parameters[:series] && !parameters[:type]
|
27
|
+
|
28
|
+
super
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
module Pubid::Itu
|
2
|
+
class Parser < Pubid::Core::Parser
|
3
|
+
rule(:roman_numerals) do
|
4
|
+
array_to_str(%w[I V X L C D M]).repeat(1).as(:roman_numerals)
|
5
|
+
end
|
6
|
+
|
7
|
+
rule(:part) do
|
8
|
+
(dash >> year_digits.absent? >> digits.as(:part)).repeat
|
9
|
+
end
|
10
|
+
|
11
|
+
rule(:type) do
|
12
|
+
(dash | space) >> str("REC").as(:type)
|
13
|
+
end
|
14
|
+
|
15
|
+
rule(:subseries) do
|
16
|
+
dot >> digits.as(:subseries)
|
17
|
+
end
|
18
|
+
|
19
|
+
rule(:r_sector_series) do
|
20
|
+
(
|
21
|
+
# SG - Study groups for "question" type
|
22
|
+
((str("SG") >> digits).as(:series) >> dot) |
|
23
|
+
# Recommendation series
|
24
|
+
(array_to_str(Identifier.config.series["R"].keys.sort_by(&:length).reverse).as(:series) >> dot) |
|
25
|
+
# Regulatory Publications
|
26
|
+
(str("RR") | str("RRX") | str("RR5") | str("ROP") | str("HFBS")).as(:regulatory_publication) |
|
27
|
+
# "R" for resolution
|
28
|
+
(str("R").as(:series) >> dot).maybe)
|
29
|
+
end
|
30
|
+
|
31
|
+
rule(:t_sector_series) do
|
32
|
+
(
|
33
|
+
# Service Publications / Operational Bulletin
|
34
|
+
str("OB") | str("Operational Bulletin") |
|
35
|
+
# Recommendation series
|
36
|
+
array_to_str(Identifier.config.series["T"].keys.sort_by(&:length).reverse)
|
37
|
+
).capture(:series).as(:series) >>
|
38
|
+
# "No. " for Operational Bulletin
|
39
|
+
(dot | str(" No. ")).maybe
|
40
|
+
end
|
41
|
+
|
42
|
+
rule(:series_range) do
|
43
|
+
(dash >> dynamic { |s, c| str(c.captures[:series]) } >> dot >> full_number).as(:range)
|
44
|
+
end
|
45
|
+
|
46
|
+
rule(:sector_series_number) do
|
47
|
+
(
|
48
|
+
# ITU-R
|
49
|
+
(str("R").as(:sector) >> type.maybe >> (space | dash) >>
|
50
|
+
r_sector_series.maybe >> full_number.maybe) |
|
51
|
+
# ITU-T
|
52
|
+
(str("T").as(:sector) >> type.maybe >> (space | dash) >>
|
53
|
+
t_sector_series.maybe >> full_number >>
|
54
|
+
(str("/") >> t_sector_series.maybe >> full_number).as(:second_number).maybe >>
|
55
|
+
series_range.maybe) |
|
56
|
+
# ITU-D
|
57
|
+
(str("D") >> space >> full_number)
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
rule(:published) do
|
62
|
+
((str(" - ") >> digits.as(:day) >> dot >> roman_numerals.as(:month) >> dot >> year_digits.as(:year)) |
|
63
|
+
(dash >> year_digits.as(:year) >> month_digits.as(:month)) |
|
64
|
+
(space >> str("(") >> (month_digits.as(:month) >> str("/")).maybe >>
|
65
|
+
year_digits.as(:year) >> str(")"))).as(:date)
|
66
|
+
end
|
67
|
+
|
68
|
+
rule(:amendment) do
|
69
|
+
space >> (str("Amd") | str("Amend")) >> dot.maybe >> space >> digits.as(:number).as(:amendment)
|
70
|
+
end
|
71
|
+
|
72
|
+
rule(:implementers_guide) do
|
73
|
+
str("Imp").as(:type)
|
74
|
+
end
|
75
|
+
|
76
|
+
rule(:full_number) do
|
77
|
+
# Parse X.ImpOSI
|
78
|
+
((implementers_guide >> str("OSI").as(:number)) |
|
79
|
+
(implementers_guide.maybe >> digits.as(:number).maybe)
|
80
|
+
) >> subseries.maybe >> part
|
81
|
+
end
|
82
|
+
|
83
|
+
rule(:supplement) do
|
84
|
+
space >> (str("Suppl.") >> space >> digits.as(:number)).as(:supplement)
|
85
|
+
end
|
86
|
+
|
87
|
+
rule(:annex) do
|
88
|
+
space >> str("Annex") >> space >> (match["A-Z"] >> digits.maybe >> str("+").maybe).as(:number).as(:annex)
|
89
|
+
end
|
90
|
+
|
91
|
+
rule(:corrigendum) do
|
92
|
+
(published >> space >> str("Cor.") >> space >>
|
93
|
+
digits.as(:number)).as(:corrigendum)
|
94
|
+
end
|
95
|
+
|
96
|
+
rule(:addendum) do
|
97
|
+
(published >> space >> str("Add.") >> space >> digits.as(:number)).as(:addendum)
|
98
|
+
end
|
99
|
+
|
100
|
+
rule(:appendix) do
|
101
|
+
(space >> str("App.") >> space >>
|
102
|
+
roman_numerals.as(:number)).as(:appendix)
|
103
|
+
end
|
104
|
+
|
105
|
+
rule(:identifier) do
|
106
|
+
str("ITU") >> (dash | space) >> sector_series_number >> supplement.maybe >>
|
107
|
+
annex.maybe >> corrigendum.maybe >> addendum.maybe >> appendix.maybe >>
|
108
|
+
published.maybe >> amendment.maybe >> str("-I").maybe
|
109
|
+
end
|
110
|
+
|
111
|
+
rule(:root) { identifier }
|
112
|
+
end
|
113
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module Pubid::Itu::Renderer
|
2
|
+
class Base < Pubid::Core::Renderer::Base
|
3
|
+
TYPE_PREFIX = "".freeze
|
4
|
+
|
5
|
+
def render(**args)
|
6
|
+
render_base_identifier(**args) + @prerendered_params[:language].to_s
|
7
|
+
end
|
8
|
+
|
9
|
+
def render_type_series(params)
|
10
|
+
"%{type}%{series}" % params
|
11
|
+
end
|
12
|
+
|
13
|
+
def render_identifier(params)
|
14
|
+
"%{publisher}-%{sector} #{render_type_series(params)}%{number}%{subseries}"\
|
15
|
+
"%{part}%{second_number}%{range}%{annex}%{amendment}%{corrigendum}%{supplement}"\
|
16
|
+
"%{addendum}%{appendix}%{date}" % params
|
17
|
+
end
|
18
|
+
|
19
|
+
def render_number(number, _opts, params)
|
20
|
+
params[:series] ? ".#{number}" : number
|
21
|
+
end
|
22
|
+
|
23
|
+
def render_date(date, opts, _params)
|
24
|
+
return if opts[:without_date]
|
25
|
+
|
26
|
+
return " (#{date[:year]})" unless date[:month]
|
27
|
+
|
28
|
+
" (%<month>02d/%<year>d)" % date
|
29
|
+
end
|
30
|
+
|
31
|
+
def render_type(type, opts, _params)
|
32
|
+
"#{type}-" if opts[:with_type]
|
33
|
+
end
|
34
|
+
|
35
|
+
def render_part(part, opts, _params)
|
36
|
+
return "-#{part.reverse.join('-')}" if part.is_a?(Array)
|
37
|
+
|
38
|
+
"-#{part}"
|
39
|
+
end
|
40
|
+
|
41
|
+
def render_series(series, _opts, _params)
|
42
|
+
"#{series}"
|
43
|
+
end
|
44
|
+
|
45
|
+
def render_amendment(amendment, _opts, _params)
|
46
|
+
" Amd #{amendment[:number]}"
|
47
|
+
end
|
48
|
+
|
49
|
+
def render_subseries(subseries, _opts, _params)
|
50
|
+
".#{subseries}"
|
51
|
+
end
|
52
|
+
|
53
|
+
def render_second_number(second_number, _opts, _params)
|
54
|
+
result = "/#{second_number[:series]}.#{second_number[:number]}"
|
55
|
+
if second_number[:subseries]
|
56
|
+
result += ".#{second_number[:subseries]}"
|
57
|
+
end
|
58
|
+
if second_number[:part]
|
59
|
+
result += "-#{second_number[:part]}"
|
60
|
+
end
|
61
|
+
|
62
|
+
result
|
63
|
+
end
|
64
|
+
|
65
|
+
def render_supplement(supplement, _opts, _params)
|
66
|
+
" Suppl. #{supplement[:number]}"
|
67
|
+
end
|
68
|
+
|
69
|
+
def render_annex(annex, _opts, _params)
|
70
|
+
" Annex #{annex[:number]}"
|
71
|
+
end
|
72
|
+
|
73
|
+
def render_corrigendum(corrigendum, opts, params)
|
74
|
+
"#{render_date(corrigendum[:date], opts, params)} Cor. #{corrigendum[:number]}"
|
75
|
+
end
|
76
|
+
|
77
|
+
def render_range(range, _opts, params)
|
78
|
+
"-#{params[:series]}.#{range[:number]}"
|
79
|
+
end
|
80
|
+
|
81
|
+
def render_addendum(addendum, opts, params)
|
82
|
+
"#{render_date(addendum[:date], opts, params)} Add. #{addendum[:number]}"
|
83
|
+
end
|
84
|
+
|
85
|
+
def render_appendix(appendix, _opts, _params)
|
86
|
+
" App. #{appendix[:number]}"
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Pubid::Itu::Renderer
|
2
|
+
class ImplementersGuide < Base
|
3
|
+
def render_type_series(params)
|
4
|
+
"%{series}%{type}" % params
|
5
|
+
end
|
6
|
+
|
7
|
+
def render_number(number, _opts, params)
|
8
|
+
number
|
9
|
+
end
|
10
|
+
|
11
|
+
def render_type(type, opts, _params)
|
12
|
+
params[:series] ? ".Imp" : "Imp"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/pubid/itu.rb
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "parslet"
|
4
|
+
require "yaml"
|
5
|
+
|
6
|
+
module Pubid
|
7
|
+
module Itu
|
8
|
+
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
require "pubid-core"
|
13
|
+
|
14
|
+
require_relative "itu/errors"
|
15
|
+
require_relative "itu/identifier/base"
|
16
|
+
require_relative "itu/identifier/recommendation"
|
17
|
+
require_relative "itu/identifier/question"
|
18
|
+
require_relative "itu/identifier/resolution"
|
19
|
+
require_relative "itu/identifier/special_publication"
|
20
|
+
require_relative "itu/identifier/supplement"
|
21
|
+
require_relative "itu/identifier/amendment"
|
22
|
+
require_relative "itu/identifier/regulatory_publication"
|
23
|
+
require_relative "itu/identifier/implementers_guide"
|
24
|
+
require_relative "itu/identifier/annex"
|
25
|
+
require_relative "itu/identifier/corrigendum"
|
26
|
+
require_relative "itu/identifier/addendum"
|
27
|
+
require_relative "itu/identifier/appendix"
|
28
|
+
require_relative "itu/transformer"
|
29
|
+
require_relative "itu/renderer/base"
|
30
|
+
require_relative "itu/renderer/implementers_guide"
|
31
|
+
require_relative "itu/parser"
|
32
|
+
require_relative "itu/identifier"
|
33
|
+
require_relative "itu/configuration"
|
34
|
+
|
35
|
+
config = Pubid::Itu::Configuration.new
|
36
|
+
config.default_type = Pubid::Itu::Identifier::Base
|
37
|
+
config.types = [Pubid::Itu::Identifier::Base,
|
38
|
+
Pubid::Itu::Identifier::Recommendation,
|
39
|
+
Pubid::Itu::Identifier::Resolution,
|
40
|
+
Pubid::Itu::Identifier::Question,
|
41
|
+
Pubid::Itu::Identifier::SpecialPublication,
|
42
|
+
Pubid::Itu::Identifier::Amendment,
|
43
|
+
Pubid::Itu::Identifier::Corrigendum,
|
44
|
+
Pubid::Itu::Identifier::RegulatoryPublication,
|
45
|
+
Pubid::Itu::Identifier::ImplementersGuide,
|
46
|
+
Pubid::Itu::Identifier::Supplement,
|
47
|
+
Pubid::Itu::Identifier::Annex,
|
48
|
+
Pubid::Itu::Identifier::Addendum,
|
49
|
+
Pubid::Itu::Identifier::Appendix]
|
50
|
+
config.type_names = {}.freeze
|
51
|
+
config.series = YAML.load_file(File.join(File.dirname(__FILE__), "../../series.yaml"))
|
52
|
+
Pubid::Itu::Identifier.set_config(config)
|
data/lib/pubid-itu.rb
ADDED
data/series.yaml
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
R:
|
2
|
+
BO: Satellite delivery
|
3
|
+
BR: Recording for production, archival and play-out; film for television
|
4
|
+
BS: Broadcasting service (sound)
|
5
|
+
BT: Broadcasting service (television)
|
6
|
+
F: Fixed service
|
7
|
+
M: Mobile, radiodetermination, amateur and related satellite services
|
8
|
+
P: Radiowave propagation
|
9
|
+
RA: Radio astronomy
|
10
|
+
RS: Remote sensing systems
|
11
|
+
S: Fixed-satellite service
|
12
|
+
SA: Space applications and meteorology
|
13
|
+
SF: Frequency sharing and coordination between fixed-satellite and fixed service systems SM Spectrum management
|
14
|
+
SM: Spectrum management
|
15
|
+
SNG: Satellite news gathering
|
16
|
+
TF: Time signals and frequency standards emissions
|
17
|
+
V: Vocabulary and related subjects
|
18
|
+
|
19
|
+
T:
|
20
|
+
A: Organization of the work of ITU-T
|
21
|
+
D: Tariff and accounting principles and international telecommunication/ICT economic and policy issues
|
22
|
+
E: Overall network operation, telephone service, service operation and human factors
|
23
|
+
F: Non-telephone telecommunication services
|
24
|
+
G: Transmission systems and media, digital systems and networks
|
25
|
+
H: Audiovisual and multimedia systems
|
26
|
+
I: Integrated services digital network
|
27
|
+
J: Cable networks and transmission of television, sound programme and other multimedia signals
|
28
|
+
K: Protection against interference
|
29
|
+
L: Environment and ICTs, climate change, e-waste, energy efficiency; construction, installation and protection of cables and other elements of outside plant
|
30
|
+
M: Telecommunication management, including TMN and network maintenance
|
31
|
+
N: "Maintenance: international sound programme and television-transmission circuits"
|
32
|
+
O: Specifications of measuring equipment
|
33
|
+
P: Telephone transmission quality, telephone installations, local line networks
|
34
|
+
Q: Switching and signalling, and associated measurements and tests
|
35
|
+
R: Telegraph transmission
|
36
|
+
S: Telegraph services terminal equipment
|
37
|
+
T: Terminals for telematic services
|
38
|
+
U: Telegraph switching
|
39
|
+
V: Data communication over the telephone network
|
40
|
+
X: Data networks, open system communications and security
|
41
|
+
Y: Global information infrastructure, Internet protocol aspects, next-generation networks, Internet of Things and smart cities
|
42
|
+
Z: Languages and general software aspects for telecommunication systems
|
metadata
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pubid-itu
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ribose Inc.
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-01-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '13.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '13.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: parslet
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pubid-core
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.8.5
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.8.5
|
69
|
+
description: Library to generate, parse and manipulate ITU PubID.
|
70
|
+
email:
|
71
|
+
- open.source@ribose.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files:
|
75
|
+
- README.adoc
|
76
|
+
- LICENSE.txt
|
77
|
+
files:
|
78
|
+
- LICENSE.txt
|
79
|
+
- README.adoc
|
80
|
+
- lib/pubid-itu.rb
|
81
|
+
- lib/pubid/itu.rb
|
82
|
+
- lib/pubid/itu/configuration.rb
|
83
|
+
- lib/pubid/itu/errors.rb
|
84
|
+
- lib/pubid/itu/identifier.rb
|
85
|
+
- lib/pubid/itu/identifier/addendum.rb
|
86
|
+
- lib/pubid/itu/identifier/amendment.rb
|
87
|
+
- lib/pubid/itu/identifier/annex.rb
|
88
|
+
- lib/pubid/itu/identifier/appendix.rb
|
89
|
+
- lib/pubid/itu/identifier/base.rb
|
90
|
+
- lib/pubid/itu/identifier/corrigendum.rb
|
91
|
+
- lib/pubid/itu/identifier/implementers_guide.rb
|
92
|
+
- lib/pubid/itu/identifier/question.rb
|
93
|
+
- lib/pubid/itu/identifier/recommendation.rb
|
94
|
+
- lib/pubid/itu/identifier/regulatory_publication.rb
|
95
|
+
- lib/pubid/itu/identifier/resolution.rb
|
96
|
+
- lib/pubid/itu/identifier/special_publication.rb
|
97
|
+
- lib/pubid/itu/identifier/supplement.rb
|
98
|
+
- lib/pubid/itu/parser.rb
|
99
|
+
- lib/pubid/itu/renderer/base.rb
|
100
|
+
- lib/pubid/itu/renderer/implementers_guide.rb
|
101
|
+
- lib/pubid/itu/transformer.rb
|
102
|
+
- lib/pubid/itu/version.rb
|
103
|
+
- series.yaml
|
104
|
+
homepage: https://github.com/metanorma/pubid-itu
|
105
|
+
licenses:
|
106
|
+
- BSD-2-Clause
|
107
|
+
metadata: {}
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 2.5.0
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubygems_version: 3.3.26
|
124
|
+
signing_key:
|
125
|
+
specification_version: 4
|
126
|
+
summary: Library to generate, parse and manipulate ITU PubID.
|
127
|
+
test_files: []
|