relaton-iho 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: 86d710da9b97b769ffffa9b42765e8b953b42d78f9a1528ae84e0426562812af
4
- data.tar.gz: 2776acafcc19b1e959ecc5c5f183ce74b4fa033ae40a40bfbe83379eebcd2a6f
3
+ metadata.gz: a34fe61f191f15b4f9bd2896026ad6135ca6ae4e9682668ccc44b3015a83e367
4
+ data.tar.gz: fb58a578ac9a5af772237ee218cfb160e18b932cf88fa79497da1410e30cd220
5
5
  SHA512:
6
- metadata.gz: fae3afa87bd593e6245bdaedaed955ea3e4e5ae49f898549ce244e9742591aad80bf33a3436f334a9e1aea4d6898456741d5fada7a3d31d927be428311988f10
7
- data.tar.gz: d91cd33057f9ad518a029820609396067d7152d3e75c5a81d10326d32e1107052477274f262225c3335b5e9d5cc31bbbc964e412d1ffa156754d8168ad6a82c3
6
+ metadata.gz: cf24b4b1dfec02601c32c3be5b0130d5a099bf3cd238dc091834d601c0290fecc89a3fc1a6b9e669996cff94ce968a638ce182edf299a0001b9e250c78cd309c
7
+ data.tar.gz: a927a1545ff80aeda7cf65cdb888b27fda1d2f7d878fefd96cafcfe1085fb2fbf283cae2163dbf722b9cb1e76717eaf7b40d35eed5b5a04d6aa1547776b9e794
@@ -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,17 @@
1
+ module RelatonIho
2
+ class DocumentType < RelatonBib::DocumentType
3
+ DOCTYPES = %w[policy-and-procedures best-practices supporting-document
4
+ report legal directives proposal standard].freeze
5
+
6
+ def initialize(type:, abbreviation: nil)
7
+ check_type type
8
+ super
9
+ end
10
+
11
+ def check_type(type)
12
+ unless DOCTYPES.include? type
13
+ Util.warn "WARNING: invalid doctype: `#{type}`"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,54 +1,58 @@
1
1
  module RelatonIho
2
- class HashConverter < RelatonBib::HashConverter
3
- class << self
4
- # @override RelatonIsoBib::HashConverter.hash_to_bib
5
- # @param args [Hash]
6
- # @param nested [TrueClass, FalseClass]
7
- # @return [Hash]
8
- def hash_to_bib(args)
9
- ret = super
10
- return if ret.nil?
11
-
12
- commentperiod_hash_to_bib ret
13
- ret
14
- end
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
5
+ # @override RelatonIsoBib::HashConverter.hash_to_bib
6
+ # @param args [Hash]
7
+ # @param nested [TrueClass, FalseClass]
8
+ # @return [Hash]
9
+ def hash_to_bib(args)
10
+ ret = super
11
+ return if ret.nil?
12
+
13
+ commentperiod_hash_to_bib ret
14
+ ret
15
+ end
15
16
 
16
- private
17
+ private
17
18
 
18
- # @param item_hash [Hash]
19
- # @return [RelatonBib::BibliographicItem]
20
- def bib_item(**item_hash)
21
- IhoBibliographicItem.new(**item_hash)
22
- end
19
+ # @param item_hash [Hash]
20
+ # @return [RelatonBib::BibliographicItem]
21
+ def bib_item(**item_hash)
22
+ IhoBibliographicItem.new(**item_hash)
23
+ end
23
24
 
24
- # @param ret [Hash]
25
- def commentperiod_hash_to_bib(ret)
26
- ret[:commentperiod] &&= CommentPeriond.new(**ret[:commentperiod])
27
- end
25
+ # @param ret [Hash]
26
+ def commentperiod_hash_to_bib(ret)
27
+ ret[:commentperiod] &&= CommentPeriond.new(**ret[:commentperiod])
28
+ end
28
29
 
29
- # @param ret [Hash]
30
- def editorialgroup_hash_to_bib(ret)
31
- eg = ret[:editorialgroup]
32
- return unless eg.is_a?(Hash) || eg&.any?
30
+ # @param ret [Hash]
31
+ def editorialgroup_hash_to_bib(ret)
32
+ eg = ret[:editorialgroup]
33
+ return unless eg.is_a?(Hash) || eg&.any?
33
34
 
34
- collection = RelatonBib.array(eg).map do |g|
35
- EditorialGroup.new(RelatonBib.array(g).map { |wg| iho_workgroup wg })
36
- end
37
- ret[:editorialgroup] = EditorialGroupCollection.new collection
35
+ collection = RelatonBib.array(eg).map do |g|
36
+ EditorialGroup.new(RelatonBib.array(g).map { |wg| iho_workgroup wg })
38
37
  end
38
+ ret[:editorialgroup] = EditorialGroupCollection.new collection
39
+ end
39
40
 
40
- # @param ihowg [Hash]
41
- # @return [RelatonIho::Committee, RelatonIho::Workgroup,
42
- # RelatonIho::Commission]
43
- def iho_workgroup(ihowg)
44
- key, value = ihowg&.first
45
- return unless key && value.is_a?(Hash)
46
-
47
- klass = Object.const_get "RelatonIho::#{key.capitalize}"
48
- wgs = %i[committee workgroup commission]
49
- subwg = value.select { |k, _| wgs.include? k }
50
- klass.new value[:abbreviation], value[:name], iho_workgroup(subwg)
51
- end
41
+ # @param ihowg [Hash]
42
+ # @return [RelatonIho::Committee, RelatonIho::Workgroup,
43
+ # RelatonIho::Commission]
44
+ def iho_workgroup(ihowg)
45
+ key, value = ihowg&.first
46
+ return unless key && value.is_a?(Hash)
47
+
48
+ klass = Object.const_get "RelatonIho::#{key.capitalize}"
49
+ wgs = %i[committee workgroup commission]
50
+ subwg = value.select { |k, _| wgs.include? k }
51
+ klass.new value[:abbreviation], value[:name], iho_workgroup(subwg)
52
+ end
53
+
54
+ def create_doctype(**args)
55
+ DocumentType.new(**args)
52
56
  end
53
57
  end
54
58
  end
@@ -1,8 +1,5 @@
1
1
  module RelatonIho
2
2
  class IhoBibliographicItem < RelatonBib::BibliographicItem
3
- TYPES = %w[policy-and-procedures best-practices supporting-document
4
- report legal directives proposal standard].freeze
5
-
6
3
  # @return [RelatonIho::CommentPeriod, NilClass]
7
4
  attr_reader :commentperiod
8
5
 
@@ -39,7 +36,7 @@ module RelatonIho
39
36
  if opts[:bibdata] && (doctype || editorialgroup&.presence? ||
40
37
  ics.any? || commentperiod)
41
38
  ext = b.ext do
42
- b.doctype doctype if doctype
39
+ doctype&.to_xml b
43
40
  editorialgroup&.to_xml b
44
41
  ics.each { |i| i.to_xml b }
45
42
  commentperiod&.to_xml b
@@ -1,3 +1,3 @@
1
1
  module RelatonIho
2
- VERSION = "1.16.2".freeze
2
+ VERSION = "1.17.0".freeze
3
3
  end
data/lib/relaton_iho.rb CHANGED
@@ -5,6 +5,7 @@ require "relaton/index"
5
5
  require "relaton_iho/version"
6
6
  require "relaton_iho/config"
7
7
  require "relaton_iho/util"
8
+ require "relaton_iho/document_type"
8
9
  require "relaton_iho/iho_bibliography"
9
10
  require "relaton_iho/hash_converter"
10
11
  require "relaton_iho/xml_parser"
data/relaton_iho.gemspec CHANGED
@@ -21,6 +21,6 @@ Gem::Specification.new do |s|
21
21
  s.require_paths = ["lib"]
22
22
  s.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
23
23
 
24
- s.add_dependency "relaton-bib", "~> 1.16.0"
24
+ s.add_dependency "relaton-bib", "~> 1.17.0"
25
25
  s.add_dependency "relaton-index", "~> 0.2.0"
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iho
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: bin
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
@@ -63,6 +63,7 @@ files:
63
63
  - lib/relaton_iho.rb
64
64
  - lib/relaton_iho/comment_periond.rb
65
65
  - lib/relaton_iho/config.rb
66
+ - lib/relaton_iho/document_type.rb
66
67
  - lib/relaton_iho/editorial_group.rb
67
68
  - lib/relaton_iho/eg.yml
68
69
  - lib/relaton_iho/hash_converter.rb