relaton-un 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 +4 -4
- data/grammars/basicdoc.rng +18 -2
- data/grammars/biblio.rng +1 -0
- data/lib/relaton_un/document_type.rb +19 -0
- data/lib/relaton_un/hash_converter.rb +29 -25
- data/lib/relaton_un/un_bibliographic_item.rb +1 -6
- data/lib/relaton_un/version.rb +1 -1
- data/lib/relaton_un.rb +1 -0
- data/relaton_un.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce8d84211462e89a7e3fa8209cc642b62bc91ce3d59a137eb038c9e974b3e5c6
|
4
|
+
data.tar.gz: d1f53b8c63ffd65e91b85b26967b709b962cf5f1e69ac5e94143e3ac1029b9e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ffd4b9333da7e1ea09bb218fd20258126a77f571c48a800700cd72dd05d5b305dd36a676fefa927f175214b76e48e8ba45e2a87851d5e47a2202d9fad4450a3
|
7
|
+
data.tar.gz: 97053ef71c9b3b2a6728dec4402cb8ef181c9095687c3bf57676c8fc3f4e0d50b73956d5ad6606a0f511c8c3d4d183f50677ffe87a09a87d6354dd513f33594d
|
data/grammars/basicdoc.rng
CHANGED
@@ -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
|
-
<
|
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
|
-
<
|
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
@@ -0,0 +1,19 @@
|
|
1
|
+
module RelatonUn
|
2
|
+
class DocumentType < RelatonBib::DocumentType
|
3
|
+
DOCTYPES = %w[
|
4
|
+
recommendation plenary addendum communication corrigendum reissue agenda
|
5
|
+
budgetary sec-gen-notes expert-report resolution
|
6
|
+
].freeze
|
7
|
+
|
8
|
+
def initialize(type:, abbreviation: nil)
|
9
|
+
check_type type
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
def check_type(type)
|
14
|
+
unless DOCTYPES.include? type
|
15
|
+
Util.warn "WARNING: invalid doctype: `#{type}`"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,34 +1,38 @@
|
|
1
1
|
module RelatonUn
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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?
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ret[:submissionlanguage] = RelatonBib.array ret[:submissionlanguage]
|
14
|
+
session_hash_to_bib ret
|
15
|
+
ret
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
16
19
|
|
17
|
-
|
20
|
+
# @param ret [Hash]
|
21
|
+
def session_hash_to_bib(ret)
|
22
|
+
ret[:session] = Session.new(**ret[:session]) if ret[:session]
|
23
|
+
end
|
18
24
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
25
|
+
# @param ret [Hash]
|
26
|
+
def editorialgroup_hash_to_bib(ret)
|
27
|
+
eg = ret[:editorialgroup]
|
28
|
+
return unless eg
|
23
29
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
return unless eg
|
30
|
+
committee = eg.map { |e| e[:committee] }
|
31
|
+
ret[:editorialgroup] = EditorialGroup.new RelatonBib.array(committee)
|
32
|
+
end
|
28
33
|
|
29
|
-
|
30
|
-
|
31
|
-
end
|
34
|
+
def create_doctype(**args)
|
35
|
+
DocumentType.new(**args)
|
32
36
|
end
|
33
37
|
end
|
34
38
|
end
|
@@ -2,11 +2,6 @@ module RelatonUn
|
|
2
2
|
class UnBibliographicItem < RelatonBib::BibliographicItem
|
3
3
|
include RelatonBib
|
4
4
|
|
5
|
-
TYPES = %w[
|
6
|
-
recommendation plenary addendum communication corrigendum reissue agenda
|
7
|
-
budgetary sec-gen-notes expert-report resolution
|
8
|
-
].freeze
|
9
|
-
|
10
5
|
DISTRIBUTIONS = { "GEN" => "general", "LTD" => "limited",
|
11
6
|
"DER" => "restricted", "PRO" => "provisional" }.freeze
|
12
7
|
|
@@ -50,7 +45,7 @@ module RelatonUn
|
|
50
45
|
def to_xml(**opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
51
46
|
super(**opts) do |b|
|
52
47
|
ext = b.ext do
|
53
|
-
|
48
|
+
doctype&.to_xml b
|
54
49
|
submissionlanguage&.each { |sl| b.submissionlanguage sl }
|
55
50
|
editorialgroup&.to_xml b
|
56
51
|
ics&.each { |i| i.to_xml b }
|
data/lib/relaton_un/version.rb
CHANGED
data/lib/relaton_un.rb
CHANGED
data/relaton_un.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_dependency "addressable", "~> 2.8.0"
|
36
36
|
spec.add_dependency "faraday", "~> 2.7.0"
|
37
37
|
spec.add_dependency "http-cookie", "~> 1.0.5"
|
38
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
38
|
+
spec.add_dependency "relaton-bib", "~> 1.17.0"
|
39
39
|
spec.add_dependency "unf_ext", ">= 0.0.7.7"
|
40
40
|
end
|
41
41
|
# rubocop:enable Metrics/BlockLength
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-un
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
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-
|
11
|
+
date: 2023-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.17.0
|
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.17.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: unf_ext
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- grammars/relaton-un.rng
|
108
108
|
- lib/relaton_un.rb
|
109
109
|
- lib/relaton_un/config.rb
|
110
|
+
- lib/relaton_un/document_type.rb
|
110
111
|
- lib/relaton_un/editorialgroup.rb
|
111
112
|
- lib/relaton_un/hash_converter.rb
|
112
113
|
- lib/relaton_un/hit.rb
|