relaton-iana 1.10.1 → 1.11.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: 88f95a28c615d40f376060abeb732a2f27fb39433a976c39ddf5dc23286aa987
4
- data.tar.gz: b421d5f96686ef8a65a2c0218d39f14f4acc8ae100b103453532a52825f8d226
3
+ metadata.gz: a36e2e323319b37fe02fbeed92da602d41c54f9e14571f0bf236b5593c5413ab
4
+ data.tar.gz: 2767420cef8e6a4dd1568a599236ff80aac4665465f51b345cc097e33c70736d
5
5
  SHA512:
6
- metadata.gz: 717aa0c320987757c29bad0782a3cf85bf48a7782231fbc562c130ecde89a16b57e12c2bdfcc97e974de0c311b809ffeb1e1cbae9091d66f0ac333ed857cff61
7
- data.tar.gz: 746e55e7aa9559cc21f18b69c5a1ed404c861ea94f4dee136660dbfaff3b37f65beb6d44b5423fe6a3555b262ebda9344b3ddde9342af2ddd91f81744968fc82
6
+ metadata.gz: 0a18eb38627a3329feb058a5635d8bbb0f046bbbe4454149e2502596c3b412973af16ea27e3c61d481391302665f67f976cff08e2e4df933b81e9988ed2edf85
7
+ data.tar.gz: 2dcd859ba3d3027a4ae6369f1aaa2359f891839491ade60d03d2c78cc3cf78829359aab2a0ae0a388b8a8ac80f24cb0525dd77b32c67d2ae2bc20a40cc41e5e0
data/grammars/biblio.rng CHANGED
@@ -677,6 +677,9 @@
677
677
  <zeroOrMore>
678
678
  <ref name="extent"/>
679
679
  </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
680
683
  <zeroOrMore>
681
684
  <ref name="accesslocation"/>
682
685
  </zeroOrMore>
@@ -922,9 +925,29 @@
922
925
  <text/>
923
926
  </element>
924
927
  </define>
928
+ <define name="sizevalue">
929
+ <element name="value">
930
+ <attribute name="type"/>
931
+ <text/>
932
+ </element>
933
+ </define>
934
+ <define name="bibliographic_size">
935
+ <element name="size">
936
+ <oneOrMore>
937
+ <ref name="sizevalue"/>
938
+ </oneOrMore>
939
+ </element>
940
+ </define>
925
941
  <define name="extent">
926
942
  <element name="extent">
927
- <ref name="BibItemLocality"/>
943
+ <choice>
944
+ <zeroOrMore>
945
+ <ref name="locality"/>
946
+ </zeroOrMore>
947
+ <zeroOrMore>
948
+ <ref name="localityStack"/>
949
+ </zeroOrMore>
950
+ </choice>
928
951
  </element>
929
952
  </define>
930
953
  <define name="series">
data/grammars/isodoc.rng CHANGED
@@ -152,9 +152,7 @@
152
152
  <data type="boolean"/>
153
153
  </attribute>
154
154
  </optional>
155
- <oneOrMore>
156
- <ref name="PureTextElement"/>
157
- </oneOrMore>
155
+ <ref name="XrefBody"/>
158
156
  </element>
159
157
  </define>
160
158
  <define name="erefType">
@@ -188,6 +186,42 @@
188
186
  <ref name="PureTextElement"/>
189
187
  </oneOrMore>
190
188
  </define>
189
+ <define name="localityStack">
190
+ <element name="localityStack">
191
+ <optional>
192
+ <attribute name="connective">
193
+ <choice>
194
+ <value>and</value>
195
+ <value>or</value>
196
+ <value>from</value>
197
+ <value>to</value>
198
+ <value/>
199
+ </choice>
200
+ </attribute>
201
+ </optional>
202
+ <zeroOrMore>
203
+ <ref name="locality"/>
204
+ </zeroOrMore>
205
+ </element>
206
+ </define>
207
+ <define name="sourceLocalityStack">
208
+ <element name="sourceLocalityStack">
209
+ <optional>
210
+ <attribute name="connective">
211
+ <choice>
212
+ <value>and</value>
213
+ <value>or</value>
214
+ <value>from</value>
215
+ <value>to</value>
216
+ <value/>
217
+ </choice>
218
+ </attribute>
219
+ </optional>
220
+ <zeroOrMore>
221
+ <ref name="sourceLocality"/>
222
+ </zeroOrMore>
223
+ </element>
224
+ </define>
191
225
  <define name="ul">
192
226
  <element name="ul">
193
227
  <attribute name="id">
@@ -1098,6 +1132,16 @@
1098
1132
  </define>
1099
1133
  </include>
1100
1134
  <!-- end overrides -->
1135
+ <define name="image" combine="choice">
1136
+ <element name="svg">
1137
+ <oneOrMore>
1138
+ <choice>
1139
+ <text/>
1140
+ <ref name="AnyElement"/>
1141
+ </choice>
1142
+ </oneOrMore>
1143
+ </element>
1144
+ </define>
1101
1145
  <define name="MultilingualRenderingType">
1102
1146
  <choice>
1103
1147
  <value>common</value>
@@ -2631,4 +2675,30 @@
2631
2675
  </zeroOrMore>
2632
2676
  </element>
2633
2677
  </define>
2678
+ <define name="XrefBody">
2679
+ <zeroOrMore>
2680
+ <ref name="XrefTarget"/>
2681
+ </zeroOrMore>
2682
+ <oneOrMore>
2683
+ <ref name="PureTextElement"/>
2684
+ </oneOrMore>
2685
+ </define>
2686
+ <define name="XrefTarget">
2687
+ <element name="location">
2688
+ <attribute name="target">
2689
+ <data type="string">
2690
+ <param name="pattern">\i\c*|\c+#\c+</param>
2691
+ </data>
2692
+ </attribute>
2693
+ <attribute name="connective">
2694
+ <choice>
2695
+ <value>and</value>
2696
+ <value>or</value>
2697
+ <value>from</value>
2698
+ <value>to</value>
2699
+ <value/>
2700
+ </choice>
2701
+ </attribute>
2702
+ </element>
2703
+ </define>
2634
2704
  </grammar>
@@ -34,6 +34,8 @@ module RelatonIana
34
34
  #
35
35
  # Parse documents
36
36
  #
37
+ # @param [Integer] page page number
38
+ #
37
39
  def fetch(page = 1) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
38
40
  params = {
39
41
  q: "repo:ietf-ribose/iana-registries extension:xml",
@@ -61,6 +63,11 @@ module RelatonIana
61
63
  fetch(page + 1) if (json["total_count"] - (page * 100)).positive?
62
64
  end
63
65
 
66
+ #
67
+ # Fetch document
68
+ #
69
+ # @param [String] url url of document
70
+ #
64
71
  def fetch_doc(url) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
65
72
  resp = Net::HTTP.get_response URI(url)
66
73
  if resp.code == "200"
@@ -73,7 +73,19 @@ module RelatonIana
73
73
  # @return [Arra<RelatonBib::DocumentIdentifier>] docidentifier
74
74
  #
75
75
  def parse_docid
76
- [RelatonBib::DocumentIdentifier.new(type: "IANA", id: pub_id, primary: true)]
76
+ [
77
+ RelatonBib::DocumentIdentifier.new(type: "IANA", id: pub_id, primary: true),
78
+ RelatonBib::DocumentIdentifier.new(type: "IETF", id: anchor, scope: "anchor"),
79
+ ]
80
+ end
81
+
82
+ #
83
+ # Create anchor
84
+ #
85
+ # @return [String] anchor
86
+ #
87
+ def anchor
88
+ docnumber.upcase.gsub("/", "__")
77
89
  end
78
90
 
79
91
  #
@@ -85,6 +97,11 @@ module RelatonIana
85
97
  "IANA #{docnumber}"
86
98
  end
87
99
 
100
+ #
101
+ # Create docnumber
102
+ #
103
+ # @return [String] docnumber
104
+ #
88
105
  def docnumber
89
106
  dn = ""
90
107
  dn += "#{@rootdoc.docnumber}/" if @rootdoc
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIana
4
- VERSION = "1.10.1"
4
+ VERSION = "1.11.0"
5
5
  end
data/relaton_iana.gemspec CHANGED
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency "webmock"
40
40
 
41
41
  spec.add_dependency "faraday", "~> 1.8.0"
42
- spec.add_dependency "relaton-bib", "~> 1.10.1"
42
+ spec.add_dependency "relaton-bib", "~> 1.11.0"
43
43
 
44
44
  # Uncomment to register a new dependency of your gem
45
45
  # spec.add_dependency "example-gem", "~> 1.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.11.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: 2022-02-09 00:00:00.000000000 Z
11
+ date: 2022-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.10.1
145
+ version: 1.11.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.10.1
152
+ version: 1.11.0
153
153
  description: 'RelatonIana: Ruby XMLDOC impementation.'
154
154
  email:
155
155
  - open.source@ribose.com