relaton-ietf 1.16.2 → 1.18.0

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: f991e579da3f0e467e20d1af8eb3215fc4f7c03f8dca773359da7262b4557a71
4
- data.tar.gz: a8993337405ef4de678ce8b40670b93478dda1cf43c4e44bb33f1a0b13a960a0
3
+ metadata.gz: 7ccd4ea0f415da49834c5f36c55fab2221cc55513a2c3bcf2c84c3d2b3a286f4
4
+ data.tar.gz: ab1c7c6723f9b539169008884cf9046b2bf468b9e998177d8b559ffbb5f83680
5
5
  SHA512:
6
- metadata.gz: 98d758c3fbaaf0c76e8c4c144e1a7fc5d3e55ccf4f922dd242f11882c7e6d2c759f027dc9f06b344ad6d3486c84d35f237ca878e3e6c9befcfaace406c1b698c
7
- data.tar.gz: d5d739811a64be1aa4417a2958ffc9a91ca159c9a94c2655a50e6a0d6ea2d9c73684cc639edcc23939672aeae9d238f6c430216f79787ab29aae589ef6a1888a
6
+ metadata.gz: c5dff62f7628ed91866d1c7e40e1b713c83902baecd9766db1dd2774c0aaed1de4a2b47af2747c8fd0bc60c65e3ff41b3c6b7e81343016aa8188abe4cb471f9b
7
+ data.tar.gz: 63cf7decbfcd31a77138ed61d82563bff5896eb6e83a8ac278529983bdc1b59de88928e11306bbff7ffa86cde7c1002342c034730741393f83a4b587cf49c961
@@ -10,4 +10,4 @@ on:
10
10
 
11
11
  jobs:
12
12
  rake:
13
- uses: relaton/support/.github/workflows/rake.yml@master
13
+ uses: relaton/support/.github/workflows/rake.yml@main
@@ -17,7 +17,7 @@ on:
17
17
 
18
18
  jobs:
19
19
  release:
20
- uses: relaton/support/.github/workflows/release.yml@master
20
+ uses: relaton/support/.github/workflows/release.yml@main
21
21
  with:
22
22
  next_version: ${{ github.event.inputs.next_version }}
23
23
  secrets:
@@ -95,8 +95,89 @@
95
95
  <ref name="pagebreak"/>
96
96
  <ref name="hr"/>
97
97
  <ref name="bookmark"/>
98
+ <ref name="amend"/>
98
99
  </choice>
99
100
  </define>
101
+ <define name="amend">
102
+ <element name="amend">
103
+ <ref name="AmendType"/>
104
+ </element>
105
+ </define>
106
+ <define name="AmendType">
107
+ <optional>
108
+ <attribute name="id">
109
+ <data type="ID"/>
110
+ </attribute>
111
+ </optional>
112
+ <attribute name="change">
113
+ <choice>
114
+ <value>add</value>
115
+ <value>modify</value>
116
+ <value>delete</value>
117
+ <value>replace</value>
118
+ </choice>
119
+ </attribute>
120
+ <optional>
121
+ <attribute name="path"/>
122
+ </optional>
123
+ <optional>
124
+ <attribute name="path_end"/>
125
+ </optional>
126
+ <optional>
127
+ <attribute name="title"/>
128
+ </optional>
129
+ <optional>
130
+ <element name="location">
131
+ <zeroOrMore>
132
+ <choice>
133
+ <ref name="locality"/>
134
+ <ref name="localityStack"/>
135
+ </choice>
136
+ </zeroOrMore>
137
+ </element>
138
+ </optional>
139
+ <optional>
140
+ <element name="description">
141
+ <zeroOrMore>
142
+ <ref name="BasicBlock"/>
143
+ </zeroOrMore>
144
+ </element>
145
+ </optional>
146
+ <optional>
147
+ <element name="newcontent">
148
+ <optional>
149
+ <attribute name="id">
150
+ <data type="ID"/>
151
+ </attribute>
152
+ </optional>
153
+ <zeroOrMore>
154
+ <ref name="BasicBlock"/>
155
+ </zeroOrMore>
156
+ </element>
157
+ </optional>
158
+ <zeroOrMore>
159
+ <ref name="classification"/>
160
+ </zeroOrMore>
161
+ <zeroOrMore>
162
+ <ref name="contributor"/>
163
+ </zeroOrMore>
164
+ </define>
165
+ <define name="classification">
166
+ <element name="classification">
167
+ <ref name="classification_tag"/>
168
+ <ref name="classification_value"/>
169
+ </element>
170
+ </define>
171
+ <define name="classification_tag">
172
+ <element name="tag">
173
+ <text/>
174
+ </element>
175
+ </define>
176
+ <define name="classification_value">
177
+ <element name="value">
178
+ <text/>
179
+ </element>
180
+ </define>
100
181
  <define name="paragraph">
101
182
  <element name="p">
102
183
  <ref name="ParagraphType"/>
@@ -346,6 +427,8 @@
346
427
  <ref name="keyword"/>
347
428
  <ref name="xref"/>
348
429
  <ref name="hyperlink"/>
430
+ <ref name="index"/>
431
+ <ref name="index-xref"/>
349
432
  </choice>
350
433
  </oneOrMore>
351
434
  </element>
@@ -623,6 +706,8 @@
623
706
  <ref name="eref"/>
624
707
  <ref name="xref"/>
625
708
  <ref name="hyperlink"/>
709
+ <ref name="index"/>
710
+ <ref name="index-xref"/>
626
711
  </choice>
627
712
  </zeroOrMore>
628
713
  </element>
@@ -636,6 +721,8 @@
636
721
  <ref name="eref"/>
637
722
  <ref name="xref"/>
638
723
  <ref name="hyperlink"/>
724
+ <ref name="index"/>
725
+ <ref name="index-xref"/>
639
726
  </choice>
640
727
  </zeroOrMore>
641
728
  </element>
@@ -648,6 +735,8 @@
648
735
  <ref name="eref"/>
649
736
  <ref name="xref"/>
650
737
  <ref name="hyperlink"/>
738
+ <ref name="index"/>
739
+ <ref name="index-xref"/>
651
740
  </choice>
652
741
  </zeroOrMore>
653
742
  </element>
@@ -655,7 +744,11 @@
655
744
  <define name="keyword">
656
745
  <element name="keyword">
657
746
  <zeroOrMore>
658
- <ref name="PureTextElement"/>
747
+ <choice>
748
+ <ref name="PureTextElement"/>
749
+ <ref name="index"/>
750
+ <ref name="index-xref"/>
751
+ </choice>
659
752
  </zeroOrMore>
660
753
  </element>
661
754
  </define>
@@ -676,7 +769,11 @@
676
769
  <define name="strike">
677
770
  <element name="strike">
678
771
  <zeroOrMore>
679
- <ref name="PureTextElement"/>
772
+ <choice>
773
+ <ref name="PureTextElement"/>
774
+ <ref name="index"/>
775
+ <ref name="index-xref"/>
776
+ </choice>
680
777
  </zeroOrMore>
681
778
  </element>
682
779
  </define>
@@ -699,27 +796,36 @@
699
796
  </define>
700
797
  <define name="ruby">
701
798
  <element name="ruby">
702
- <zeroOrMore>
703
- <choice>
704
- <ref name="PureTextElement"/>
705
- <ref name="rp"/>
706
- <ref name="rt"/>
707
- </choice>
708
- </zeroOrMore>
799
+ <choice>
800
+ <ref name="ruby_pronunciation"/>
801
+ <ref name="ruby_annotation"/>
802
+ </choice>
803
+ <choice>
804
+ <text/>
805
+ <ref name="ruby"/>
806
+ </choice>
709
807
  </element>
710
808
  </define>
711
- <define name="rp">
712
- <element name="rp">
713
- <zeroOrMore>
714
- <ref name="PureTextElement"/>
715
- </zeroOrMore>
809
+ <define name="ruby_pronunciation">
810
+ <element name="pronunciation">
811
+ <attribute name="value"/>
812
+ <optional>
813
+ <attribute name="script"/>
814
+ </optional>
815
+ <optional>
816
+ <attribute name="lang"/>
817
+ </optional>
716
818
  </element>
717
819
  </define>
718
- <define name="rt">
719
- <element name="rt">
720
- <zeroOrMore>
721
- <ref name="PureTextElement"/>
722
- </zeroOrMore>
820
+ <define name="ruby_annotation">
821
+ <element name="annotation">
822
+ <attribute name="value"/>
823
+ <optional>
824
+ <attribute name="script"/>
825
+ </optional>
826
+ <optional>
827
+ <attribute name="lang"/>
828
+ </optional>
723
829
  </element>
724
830
  </define>
725
831
  <define name="br">
@@ -898,44 +1004,49 @@
898
1004
  -->
899
1005
  <define name="image">
900
1006
  <element name="image">
901
- <attribute name="id">
902
- <data type="ID"/>
1007
+ <ref name="Image"/>
1008
+ </element>
1009
+ </define>
1010
+ <define name="Image">
1011
+ <attribute name="id">
1012
+ <data type="ID"/>
1013
+ </attribute>
1014
+ <attribute name="src">
1015
+ <data type="anyURI"/>
1016
+ </attribute>
1017
+ <attribute name="mimetype"/>
1018
+ <optional>
1019
+ <attribute name="filename"/>
1020
+ </optional>
1021
+ <optional>
1022
+ <attribute name="width">
1023
+ <ref name="ImageSize"/>
903
1024
  </attribute>
904
- <attribute name="src">
1025
+ </optional>
1026
+ <optional>
1027
+ <attribute name="height">
1028
+ <ref name="ImageSize"/>
1029
+ </attribute>
1030
+ </optional>
1031
+ <optional>
1032
+ <attribute name="alt"/>
1033
+ </optional>
1034
+ <optional>
1035
+ <attribute name="title"/>
1036
+ </optional>
1037
+ <optional>
1038
+ <attribute name="longdesc">
905
1039
  <data type="anyURI"/>
906
1040
  </attribute>
907
- <attribute name="mimetype"/>
908
- <optional>
909
- <attribute name="filename"/>
910
- </optional>
911
- <optional>
912
- <attribute name="width">
913
- <choice>
914
- <data type="int"/>
915
- <value>auto</value>
916
- </choice>
917
- </attribute>
918
- </optional>
919
- <optional>
920
- <attribute name="height">
921
- <choice>
922
- <data type="int"/>
923
- <value>auto</value>
924
- </choice>
925
- </attribute>
926
- </optional>
927
- <optional>
928
- <attribute name="alt"/>
929
- </optional>
930
- <optional>
931
- <attribute name="title"/>
932
- </optional>
933
- <optional>
934
- <attribute name="longdesc">
935
- <data type="anyURI"/>
936
- </attribute>
937
- </optional>
938
- </element>
1041
+ </optional>
1042
+ </define>
1043
+ <define name="ImageSize">
1044
+ <choice>
1045
+ <data type="string">
1046
+ <param name="pattern">\d+([.]\d+)?(%?)</param>
1047
+ </data>
1048
+ <value>auto</value>
1049
+ </choice>
939
1050
  </define>
940
1051
  <define name="video">
941
1052
  <element name="video">
@@ -9,11 +9,42 @@
9
9
  -->
10
10
  <include href="biblio.rng">
11
11
  <define name="BibData">
12
- <ref name="BibliographicItem"/>
12
+ <ref name="StandardBibliographicItem"/>
13
13
  <optional>
14
14
  <ref name="ext"/>
15
15
  </optional>
16
16
  </define>
17
+ <define name="docrelation">
18
+ <element name="relation">
19
+ <attribute name="type">
20
+ <ref name="DocRelationType"/>
21
+ </attribute>
22
+ <optional>
23
+ <element name="description">
24
+ <ref name="FormattedString"/>
25
+ </element>
26
+ </optional>
27
+ <element name="bibitem">
28
+ <ref name="StandardReducedBibliographicItem"/>
29
+ </element>
30
+ <choice>
31
+ <zeroOrMore>
32
+ <ref name="locality"/>
33
+ </zeroOrMore>
34
+ <zeroOrMore>
35
+ <ref name="localityStack"/>
36
+ </zeroOrMore>
37
+ </choice>
38
+ <choice>
39
+ <zeroOrMore>
40
+ <ref name="sourceLocality"/>
41
+ </zeroOrMore>
42
+ <zeroOrMore>
43
+ <ref name="sourceLocalityStack"/>
44
+ </zeroOrMore>
45
+ </choice>
46
+ </element>
47
+ </define>
17
48
  </include>
18
49
  <define name="ext">
19
50
  <element name="ext">
@@ -161,4 +192,16 @@
161
192
  </optional>
162
193
  </element>
163
194
  </define>
195
+ <define name="StandardBibliographicItem">
196
+ <ref name="BibliographicItem"/>
197
+ <zeroOrMore>
198
+ <ref name="amend"/>
199
+ </zeroOrMore>
200
+ </define>
201
+ <define name="StandardReducedBibliographicItem">
202
+ <ref name="ReducedBibliographicItem"/>
203
+ <zeroOrMore>
204
+ <ref name="amend"/>
205
+ </zeroOrMore>
206
+ </define>
164
207
  </grammar>
data/grammars/biblio.rng CHANGED
@@ -241,6 +241,9 @@
241
241
  </element>
242
242
  </define>
243
243
  <define name="FullNameType">
244
+ <optional>
245
+ <ref name="name_abbreviation"/>
246
+ </optional>
244
247
  <choice>
245
248
  <group>
246
249
  <zeroOrMore>
@@ -266,6 +269,11 @@
266
269
  <ref name="variantname"/>
267
270
  </zeroOrMore>
268
271
  </define>
272
+ <define name="name_abbreviation">
273
+ <element name="abbreviation">
274
+ <ref name="LocalizedString"/>
275
+ </element>
276
+ </define>
269
277
  <define name="prefix">
270
278
  <element name="prefix">
271
279
  <ref name="LocalizedString"/>
@@ -348,6 +356,9 @@
348
356
  <zeroOrMore>
349
357
  <ref name="contact"/>
350
358
  </zeroOrMore>
359
+ <optional>
360
+ <ref name="logo"/>
361
+ </optional>
351
362
  </element>
352
363
  </define>
353
364
  <define name="orgname">
@@ -366,6 +377,21 @@
366
377
  </choice>
367
378
  </element>
368
379
  </define>
380
+ <define name="logo">
381
+ <element name="logo">
382
+ <ref name="image"/>
383
+ </element>
384
+ </define>
385
+ <define name="depiction">
386
+ <element name="depiction">
387
+ <optional>
388
+ <attribute name="scope"/>
389
+ </optional>
390
+ <zeroOrMore>
391
+ <ref name="image"/>
392
+ </zeroOrMore>
393
+ </element>
394
+ </define>
369
395
  <define name="NameWithVariants">
370
396
  <element name="primary">
371
397
  <ref name="LocalizedString"/>
@@ -752,6 +778,9 @@
752
778
  <optional>
753
779
  <ref name="validity"/>
754
780
  </optional>
781
+ <optional>
782
+ <ref name="depiction"/>
783
+ </optional>
755
784
  </define>
756
785
  <define name="ReducedBibliographicItem">
757
786
  <optional>
@@ -849,6 +878,9 @@
849
878
  <optional>
850
879
  <ref name="validity"/>
851
880
  </optional>
881
+ <optional>
882
+ <ref name="depiction"/>
883
+ </optional>
852
884
  </define>
853
885
  <define name="btitle">
854
886
  <element name="title">
@@ -942,6 +974,7 @@
942
974
  <value>obsoleted</value>
943
975
  <value>confirmed</value>
944
976
  <value>updated</value>
977
+ <value>corrected</value>
945
978
  <value>issued</value>
946
979
  <value>transmitted</value>
947
980
  <value>copied</value>
@@ -0,0 +1,16 @@
1
+ module RelatonIetf
2
+ class DocumentType < RelatonBib::DocumentType
3
+ DOCTYPES = %w[rfc internet-draft].freeze
4
+
5
+ def initialize(type:, abbreviation: nil)
6
+ check_type type
7
+ super
8
+ end
9
+
10
+ def check_type(type)
11
+ unless DOCTYPES.include? type
12
+ Util.warn "WARNING: Invalid doctype: `#{type}`"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,36 +1,40 @@
1
1
  module RelatonIetf
2
- class HashConverter < RelatonBib::HashConverter
3
- class << self
4
- def hash_to_bib(hash)
5
- ret = super
6
- return unless ret
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
5
+ def hash_to_bib(hash)
6
+ ret = super
7
+ return unless ret
7
8
 
8
- stream_hash_to_bib ret
9
- ret
10
- end
9
+ stream_hash_to_bib ret
10
+ ret
11
+ end
11
12
 
12
- #
13
- # Ovverides superclass's method
14
- #
15
- # @param item [Hash]
16
- # @retirn [RelatonIetf::IetfBibliographicItem]
17
- def bib_item(item)
18
- IetfBibliographicItem.new(**item)
19
- end
13
+ #
14
+ # Ovverides superclass's method
15
+ #
16
+ # @param item [Hash]
17
+ # @retirn [RelatonIetf::IetfBibliographicItem]
18
+ def bib_item(item)
19
+ IetfBibliographicItem.new(**item)
20
+ end
20
21
 
21
- # @param ret [Hash]
22
- def editorialgroup_hash_to_bib(ret)
23
- return unless ret[:editorialgroup]
22
+ # @param ret [Hash]
23
+ def editorialgroup_hash_to_bib(ret)
24
+ return unless ret[:editorialgroup]
24
25
 
25
- technical_committee = RelatonBib.array(ret[:editorialgroup]).map do |wg|
26
- Committee.new RelatonBib::WorkGroup.new(**wg)
27
- end
28
- ret[:editorialgroup] = RelatonBib::EditorialGroup.new technical_committee
26
+ technical_committee = RelatonBib.array(ret[:editorialgroup]).map do |wg|
27
+ Committee.new RelatonBib::WorkGroup.new(**wg)
29
28
  end
29
+ ret[:editorialgroup] = RelatonBib::EditorialGroup.new technical_committee
30
+ end
30
31
 
31
- def stream_hash_to_bib(ret)
32
- ret[:stream] = ret[:ext][:stream] if ret[:ext]&.key? :stream
33
- end
32
+ def stream_hash_to_bib(ret)
33
+ ret[:stream] = ret[:ext][:stream] if ret[:ext]&.key? :stream
34
+ end
35
+
36
+ def create_doctype(**args)
37
+ DocumentType.new(**args)
34
38
  end
35
39
  end
36
40
  end
@@ -1,20 +1,14 @@
1
1
  module RelatonIetf
2
2
  class IetfBibliographicItem < RelatonBib::BibliographicItem
3
- DOCTYPES = %w[rfc internet-draft].freeze
4
-
5
3
  # @return [String, nil]
6
- attr_reader :doctype, :stream
4
+ attr_reader :stream
7
5
 
8
6
  # @return [Array<String>]
9
7
  attr_reader :keyword
10
8
 
11
- # @param doctype [String]
12
9
  # @param keyword [Array<String>]
13
10
  # @param stream [String, nil]
14
11
  def initialize(**args)
15
- if args[:doctype] && !DOCTYPES.include?(args[:doctype])
16
- Util.warn "WARNING: Invalid doctype: `#{args[:doctype]}`"
17
- end
18
12
  @stream = args.delete(:stream)
19
13
  super
20
14
  end
@@ -47,7 +41,7 @@ module RelatonIetf
47
41
  if opts[:bibdata] && (doctype || editorialgroup || ics&.any? ||
48
42
  structuredidentifier&.presence? || stream)
49
43
  ext = builder.ext do |b|
50
- b.doctype doctype if doctype
44
+ doctype&.to_xml b
51
45
  b.subdoctype subdoctype if subdoctype
52
46
  editorialgroup&.to_xml b
53
47
  ics.each { |i| i.to_xml b }
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "1.16.2".freeze
2
+ VERSION = "1.18.0".freeze
3
3
  end
data/lib/relaton_ietf.rb CHANGED
@@ -6,6 +6,7 @@ require "relaton_bib"
6
6
  require "relaton_ietf/version"
7
7
  require "relaton_ietf/config"
8
8
  require "relaton_ietf/util"
9
+ require "relaton_ietf/document_type"
9
10
  require "relaton_ietf/bibxml_parser"
10
11
  require "relaton_ietf/ietf_bibliography"
11
12
  require "relaton_ietf/xml_parser"
data/relaton_ietf.gemspec CHANGED
@@ -29,6 +29,6 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
31
31
 
32
- spec.add_dependency "relaton-bib", "~> 1.16.0"
32
+ spec.add_dependency "relaton-bib", "~> 1.18.0"
33
33
  spec.add_dependency "relaton-index", "~> 0.2.3"
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.2
4
+ version: 1.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-14 00:00:00.000000000 Z
11
+ date: 2024-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: relaton-bib
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.16.0
19
+ version: 1.18.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.16.0
26
+ version: 1.18.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: relaton-index
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -73,6 +73,7 @@ files:
73
73
  - lib/relaton_ietf/committee.rb
74
74
  - lib/relaton_ietf/config.rb
75
75
  - lib/relaton_ietf/data_fetcher.rb
76
+ - lib/relaton_ietf/document_type.rb
76
77
  - lib/relaton_ietf/hash_converter.rb
77
78
  - lib/relaton_ietf/ietf_bibliographic_item.rb
78
79
  - lib/relaton_ietf/ietf_bibliography.rb