relaton-ietf 1.16.2 → 1.17.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: 4d0245047f274549b9323c06fe9d63a5150a2fe44ea57d0525aaad767d3c38b8
4
+ data.tar.gz: dfc5d69ee70eec62f5fe6b43791ab9578db892439dfe296574098c58ae6ca304
5
5
  SHA512:
6
- metadata.gz: 98d758c3fbaaf0c76e8c4c144e1a7fc5d3e55ccf4f922dd242f11882c7e6d2c759f027dc9f06b344ad6d3486c84d35f237ca878e3e6c9befcfaace406c1b698c
7
- data.tar.gz: d5d739811a64be1aa4417a2958ffc9a91ca159c9a94c2655a50e6a0d6ea2d9c73684cc639edcc23939672aeae9d238f6c430216f79787ab29aae589ef6a1888a
6
+ metadata.gz: f119f7ac88ecefa74a6baabd10dd410bcd3ad6cae78fe1fc5afebf562cc325d28097174608dacf9a47cb33e08eea1f034442ff38235dc2b44d6721b197c034ee
7
+ data.tar.gz: 4b7767b7a07caf39cd7c37db98a03ea426149a5f848389d367ce8230c6afd2b92e2dd6e2272899a5726092a3a50f1c183e5e0e186e33e75f59a43fdf48a6ffab
@@ -346,6 +346,8 @@
346
346
  <ref name="keyword"/>
347
347
  <ref name="xref"/>
348
348
  <ref name="hyperlink"/>
349
+ <ref name="index"/>
350
+ <ref name="index-xref"/>
349
351
  </choice>
350
352
  </oneOrMore>
351
353
  </element>
@@ -623,6 +625,8 @@
623
625
  <ref name="eref"/>
624
626
  <ref name="xref"/>
625
627
  <ref name="hyperlink"/>
628
+ <ref name="index"/>
629
+ <ref name="index-xref"/>
626
630
  </choice>
627
631
  </zeroOrMore>
628
632
  </element>
@@ -636,6 +640,8 @@
636
640
  <ref name="eref"/>
637
641
  <ref name="xref"/>
638
642
  <ref name="hyperlink"/>
643
+ <ref name="index"/>
644
+ <ref name="index-xref"/>
639
645
  </choice>
640
646
  </zeroOrMore>
641
647
  </element>
@@ -648,6 +654,8 @@
648
654
  <ref name="eref"/>
649
655
  <ref name="xref"/>
650
656
  <ref name="hyperlink"/>
657
+ <ref name="index"/>
658
+ <ref name="index-xref"/>
651
659
  </choice>
652
660
  </zeroOrMore>
653
661
  </element>
@@ -655,7 +663,11 @@
655
663
  <define name="keyword">
656
664
  <element name="keyword">
657
665
  <zeroOrMore>
658
- <ref name="PureTextElement"/>
666
+ <choice>
667
+ <ref name="PureTextElement"/>
668
+ <ref name="index"/>
669
+ <ref name="index-xref"/>
670
+ </choice>
659
671
  </zeroOrMore>
660
672
  </element>
661
673
  </define>
@@ -676,7 +688,11 @@
676
688
  <define name="strike">
677
689
  <element name="strike">
678
690
  <zeroOrMore>
679
- <ref name="PureTextElement"/>
691
+ <choice>
692
+ <ref name="PureTextElement"/>
693
+ <ref name="index"/>
694
+ <ref name="index-xref"/>
695
+ </choice>
680
696
  </zeroOrMore>
681
697
  </element>
682
698
  </define>
data/grammars/biblio.rng CHANGED
@@ -942,6 +942,7 @@
942
942
  <value>obsoleted</value>
943
943
  <value>confirmed</value>
944
944
  <value>updated</value>
945
+ <value>corrected</value>
945
946
  <value>issued</value>
946
947
  <value>transmitted</value>
947
948
  <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.17.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.17.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.17.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: 2023-11-27 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.17.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.17.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