pubid-itu 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pubid/itu/identifier/base.rb +1 -1
- data/lib/pubid/itu/identifier/recommendation.rb +0 -5
- data/lib/pubid/itu/identifier/supplement.rb +2 -2
- data/lib/pubid/itu/parser.rb +5 -1
- data/lib/pubid/itu/renderer/base.rb +4 -0
- data/lib/pubid/itu/renderer/implementers_guide.rb +1 -5
- data/lib/pubid/itu/transformer.rb +4 -0
- data/lib/pubid/itu/version.rb +1 -1
- data/lib/pubid/itu.rb +8 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b6a9f43860cc646babf95c556cf4aa0169f847a26415503bfa0458dd0af9af1
|
4
|
+
data.tar.gz: 6e5c30a16a55c467bb5b1d4ce00c2e6bbc7dec182b5e40815c8e8146669a10a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4049ed45d386a01a4670397674340e7c287186399c4e4b417e54b21b902b4518cc5c8660b081ee1f53e6a9cc08d947cbb7a9a0730fd7d17e0cd04aed367ec94d
|
7
|
+
data.tar.gz: c6fd2a5ad473a2325063b1112f578376d8a01947ddfdca133113a420a8357b2bdbd670b2583239ee70959fe41b80bf868dfd48e22b63215affa379d2ee55065d
|
@@ -3,11 +3,6 @@ module Pubid::Itu
|
|
3
3
|
class Recommendation < Base
|
4
4
|
def_delegators 'Pubid::Itu::Identifier::Recommendation', :type
|
5
5
|
|
6
|
-
def initialize(**opts)
|
7
|
-
# add type when Recommendation is default type
|
8
|
-
super(**opts.merge(type: "REC"))
|
9
|
-
end
|
10
|
-
|
11
6
|
def self.type
|
12
7
|
{ key: :recommendation, title: "Recommendation", short: "REC" }
|
13
8
|
end
|
@@ -10,10 +10,10 @@ module Pubid::Itu
|
|
10
10
|
@base = base
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def to_h(deep: false)
|
14
14
|
# XXX: hack to render supplements using Base renderer, because we need to
|
15
15
|
# place date published after amendment, e.g. `ITU-T G.780/Y.1351 Amd 1 (2004)`
|
16
|
-
@base.
|
16
|
+
@base.to_h(deep: deep).merge(self.type[:key] => super)
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.type
|
data/lib/pubid/itu/parser.rb
CHANGED
@@ -102,10 +102,14 @@ module Pubid::Itu
|
|
102
102
|
roman_numerals.as(:number)).as(:appendix)
|
103
103
|
end
|
104
104
|
|
105
|
+
rule(:language) do
|
106
|
+
str("-") >> match["EFASCR"].as(:language)
|
107
|
+
end
|
108
|
+
|
105
109
|
rule(:identifier) do
|
106
110
|
str("ITU") >> (dash | space) >> sector_series_number >> supplement.maybe >>
|
107
111
|
annex.maybe >> corrigendum.maybe >> addendum.maybe >> appendix.maybe >>
|
108
|
-
published.maybe >> amendment.maybe >> str("-I").maybe
|
112
|
+
published.maybe >> amendment.maybe >> str("-I").maybe >> language.maybe
|
109
113
|
end
|
110
114
|
|
111
115
|
rule(:root) { identifier }
|
@@ -1,15 +1,11 @@
|
|
1
1
|
module Pubid::Itu::Renderer
|
2
2
|
class ImplementersGuide < Base
|
3
3
|
def render_type_series(params)
|
4
|
-
"%{series}
|
4
|
+
("%{series}" % params) + (params[:series] ? ".Imp" : "Imp")
|
5
5
|
end
|
6
6
|
|
7
7
|
def render_number(number, _opts, params)
|
8
8
|
number
|
9
9
|
end
|
10
|
-
|
11
|
-
def render_type(type, opts, _params)
|
12
|
-
params[:series] ? ".Imp" : "Imp"
|
13
|
-
end
|
14
10
|
end
|
15
11
|
end
|
data/lib/pubid/itu/version.rb
CHANGED
data/lib/pubid/itu.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubid-itu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.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: 2024-
|
11
|
+
date: 2024-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.12.2
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.12.2
|
69
69
|
description: Library to generate, parse and manipulate ITU PubID.
|
70
70
|
email:
|
71
71
|
- open.source@ribose.com
|