relaton-iana 1.17.0 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -1
- data/.github/workflows/release.yml +1 -1
- data/README.adoc +5 -12
- data/grammars/basicdoc.rng +150 -52
- data/grammars/biblio-standoc.rng +44 -1
- data/grammars/biblio.rng +32 -0
- data/lib/relaton_iana/data_fetcher.rb +2 -2
- data/lib/relaton_iana/iana_bibliography.rb +3 -3
- data/lib/relaton_iana/util.rb +1 -4
- data/lib/relaton_iana/version.rb +1 -1
- data/lib/relaton_iana.rb +0 -1
- data/relaton_iana.gemspec +1 -1
- metadata +5 -6
- data/lib/relaton_iana/config.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faaf5040a9961679999269083f95112c30406aef4ac5c2d7cdfd8bc2ec9388c3
|
4
|
+
data.tar.gz: 921e1ed47fc6bfced7d9e71e84f1ed0b1408451a72454089646260eeb6088c89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75ecb4945d9fb26c7df6103ec65eb5fb449b80f8735b2a4c1acdd5abaf1fe949f8044699f7fb4a2f24617dafefea69d25592618ebae018b6eddc4a741de67953
|
7
|
+
data.tar.gz: 88bb4a360c0f8d9eb2235d336b01ab0084220276b877fb4858238451413ccbfbfce58583525ffbcfd7f1302566fd490d5212627375450100ddba4bd4a6fb7061
|
data/.github/workflows/rake.yml
CHANGED
data/README.adoc
CHANGED
@@ -23,24 +23,13 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
== Usage
|
25
25
|
|
26
|
-
===
|
27
|
-
|
28
|
-
Configuration is optional. The available option is `logger` which is a `Logger` instance. By default, the logger is `Logger.new($stderr)` with `Logger::WARN` level. To change the logger level, use `RelatonIana.configure` block.
|
26
|
+
=== Search for a standard using keywords
|
29
27
|
|
30
28
|
[source,ruby]
|
31
29
|
----
|
32
30
|
require 'relaton_iana'
|
33
31
|
=> true
|
34
32
|
|
35
|
-
RelatonIana.configure do |config|
|
36
|
-
config.logger.level = Logger::DEBUG
|
37
|
-
end
|
38
|
-
----
|
39
|
-
|
40
|
-
=== Search for a standard using keywords
|
41
|
-
|
42
|
-
[source,ruby]
|
43
|
-
----
|
44
33
|
item = RelatonIana::IanaBibliography.get "IANA service-names-port-numbers"
|
45
34
|
[relaton-iana] (IANA service-names-port-numbers) Fetching from Relaton repository ...
|
46
35
|
[relaton-iana] (IANA service-names-port-numbers) Found: `IANA service-names-port-numbers`
|
@@ -124,6 +113,10 @@ This method uses GitHub search API to fetch the documents. The search API has a
|
|
124
113
|
|
125
114
|
You can use a personal access token (PTA) to increase the rate limit. To do this, add your PTA to the `GITHUB_TOKEN` environment variable.
|
126
115
|
|
116
|
+
=== Logging
|
117
|
+
|
118
|
+
RelatonIana uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
|
119
|
+
|
127
120
|
== Development
|
128
121
|
|
129
122
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/grammars/basicdoc.rng
CHANGED
@@ -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"/>
|
@@ -163,6 +244,9 @@
|
|
163
244
|
<data type="ID"/>
|
164
245
|
</attribute>
|
165
246
|
<attribute name="reviewer"/>
|
247
|
+
<optional>
|
248
|
+
<attribute name="type"/>
|
249
|
+
</optional>
|
166
250
|
<optional>
|
167
251
|
<attribute name="date">
|
168
252
|
<data type="dateTime"/>
|
@@ -715,27 +799,36 @@
|
|
715
799
|
</define>
|
716
800
|
<define name="ruby">
|
717
801
|
<element name="ruby">
|
718
|
-
<
|
719
|
-
<
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
802
|
+
<choice>
|
803
|
+
<ref name="ruby_pronunciation"/>
|
804
|
+
<ref name="ruby_annotation"/>
|
805
|
+
</choice>
|
806
|
+
<choice>
|
807
|
+
<text/>
|
808
|
+
<ref name="ruby"/>
|
809
|
+
</choice>
|
725
810
|
</element>
|
726
811
|
</define>
|
727
|
-
<define name="
|
728
|
-
<element name="
|
729
|
-
<
|
730
|
-
|
731
|
-
|
812
|
+
<define name="ruby_pronunciation">
|
813
|
+
<element name="pronunciation">
|
814
|
+
<attribute name="value"/>
|
815
|
+
<optional>
|
816
|
+
<attribute name="script"/>
|
817
|
+
</optional>
|
818
|
+
<optional>
|
819
|
+
<attribute name="lang"/>
|
820
|
+
</optional>
|
732
821
|
</element>
|
733
822
|
</define>
|
734
|
-
<define name="
|
735
|
-
<element name="
|
736
|
-
<
|
737
|
-
|
738
|
-
|
823
|
+
<define name="ruby_annotation">
|
824
|
+
<element name="annotation">
|
825
|
+
<attribute name="value"/>
|
826
|
+
<optional>
|
827
|
+
<attribute name="script"/>
|
828
|
+
</optional>
|
829
|
+
<optional>
|
830
|
+
<attribute name="lang"/>
|
831
|
+
</optional>
|
739
832
|
</element>
|
740
833
|
</define>
|
741
834
|
<define name="br">
|
@@ -914,44 +1007,49 @@
|
|
914
1007
|
-->
|
915
1008
|
<define name="image">
|
916
1009
|
<element name="image">
|
917
|
-
<
|
918
|
-
|
1010
|
+
<ref name="Image"/>
|
1011
|
+
</element>
|
1012
|
+
</define>
|
1013
|
+
<define name="Image">
|
1014
|
+
<attribute name="id">
|
1015
|
+
<data type="ID"/>
|
1016
|
+
</attribute>
|
1017
|
+
<attribute name="src">
|
1018
|
+
<data type="anyURI"/>
|
1019
|
+
</attribute>
|
1020
|
+
<attribute name="mimetype"/>
|
1021
|
+
<optional>
|
1022
|
+
<attribute name="filename"/>
|
1023
|
+
</optional>
|
1024
|
+
<optional>
|
1025
|
+
<attribute name="width">
|
1026
|
+
<ref name="ImageSize"/>
|
919
1027
|
</attribute>
|
920
|
-
|
1028
|
+
</optional>
|
1029
|
+
<optional>
|
1030
|
+
<attribute name="height">
|
1031
|
+
<ref name="ImageSize"/>
|
1032
|
+
</attribute>
|
1033
|
+
</optional>
|
1034
|
+
<optional>
|
1035
|
+
<attribute name="alt"/>
|
1036
|
+
</optional>
|
1037
|
+
<optional>
|
1038
|
+
<attribute name="title"/>
|
1039
|
+
</optional>
|
1040
|
+
<optional>
|
1041
|
+
<attribute name="longdesc">
|
921
1042
|
<data type="anyURI"/>
|
922
1043
|
</attribute>
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
<
|
928
|
-
<
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
</choice>
|
933
|
-
</attribute>
|
934
|
-
</optional>
|
935
|
-
<optional>
|
936
|
-
<attribute name="height">
|
937
|
-
<choice>
|
938
|
-
<data type="int"/>
|
939
|
-
<value>auto</value>
|
940
|
-
</choice>
|
941
|
-
</attribute>
|
942
|
-
</optional>
|
943
|
-
<optional>
|
944
|
-
<attribute name="alt"/>
|
945
|
-
</optional>
|
946
|
-
<optional>
|
947
|
-
<attribute name="title"/>
|
948
|
-
</optional>
|
949
|
-
<optional>
|
950
|
-
<attribute name="longdesc">
|
951
|
-
<data type="anyURI"/>
|
952
|
-
</attribute>
|
953
|
-
</optional>
|
954
|
-
</element>
|
1044
|
+
</optional>
|
1045
|
+
</define>
|
1046
|
+
<define name="ImageSize">
|
1047
|
+
<choice>
|
1048
|
+
<data type="string">
|
1049
|
+
<param name="pattern">\d+([.]\d+)?(%?)</param>
|
1050
|
+
</data>
|
1051
|
+
<value>auto</value>
|
1052
|
+
</choice>
|
955
1053
|
</define>
|
956
1054
|
<define name="video">
|
957
1055
|
<element name="video">
|
data/grammars/biblio-standoc.rng
CHANGED
@@ -9,11 +9,42 @@
|
|
9
9
|
-->
|
10
10
|
<include href="biblio.rng">
|
11
11
|
<define name="BibData">
|
12
|
-
<ref name="
|
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">
|
@@ -38,7 +38,7 @@ module RelatonIana
|
|
38
38
|
content = File.read file, encoding: "UTF-8"
|
39
39
|
parse(content) if content.include? "<registry"
|
40
40
|
rescue StandardError => e
|
41
|
-
|
41
|
+
Util.error "Error: #{e.message}. File: #{file}"
|
42
42
|
end
|
43
43
|
@index.save
|
44
44
|
end
|
@@ -66,7 +66,7 @@ module RelatonIana
|
|
66
66
|
end
|
67
67
|
file = file_name(bib)
|
68
68
|
if @files.include? file
|
69
|
-
warn "File #{file} already exists. Document: #{bib.docnumber}"
|
69
|
+
Util.warn "File #{file} already exists. Document: #{bib.docnumber}"
|
70
70
|
else
|
71
71
|
@files << file
|
72
72
|
end
|
@@ -34,14 +34,14 @@ module RelatonIana
|
|
34
34
|
# @param opts [Hash] options
|
35
35
|
# @return [RelatonIana::IanaBibliographicItem]
|
36
36
|
def get(ref, _year = nil, _opts = {})
|
37
|
-
Util.
|
37
|
+
Util.info "Fetching from Relaton repository ...", key: ref
|
38
38
|
result = search(ref)
|
39
39
|
unless result
|
40
|
-
Util.
|
40
|
+
Util.info "Not found.", key: ref
|
41
41
|
return
|
42
42
|
end
|
43
43
|
|
44
|
-
Util.
|
44
|
+
Util.info "Found: `#{result.docidentifier[0].id}`", key: ref
|
45
45
|
result
|
46
46
|
end
|
47
47
|
|
data/lib/relaton_iana/util.rb
CHANGED
data/lib/relaton_iana/version.rb
CHANGED
data/lib/relaton_iana.rb
CHANGED
@@ -4,7 +4,6 @@ require "faraday"
|
|
4
4
|
require "relaton/index"
|
5
5
|
require "relaton_bib"
|
6
6
|
require_relative "relaton_iana/version"
|
7
|
-
require_relative "relaton_iana/config"
|
8
7
|
require_relative "relaton_iana/util"
|
9
8
|
require_relative "relaton_iana/iana_bibliographic_item"
|
10
9
|
require_relative "relaton_iana/xml_parser"
|
data/relaton_iana.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
|
33
33
|
spec.add_dependency "faraday", "~> 2.7.0"
|
34
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
34
|
+
spec.add_dependency "relaton-bib", "~> 1.19.0"
|
35
35
|
spec.add_dependency "relaton-index", "~> 0.2.0"
|
36
36
|
|
37
37
|
# Uncomment to register a new dependency of your gem
|
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.
|
4
|
+
version: 1.19.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:
|
11
|
+
date: 2024-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.19.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.19.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: relaton-index
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -77,7 +77,6 @@ files:
|
|
77
77
|
- grammars/relaton-iana-compile.rng
|
78
78
|
- grammars/relaton-iana.rng
|
79
79
|
- lib/relaton_iana.rb
|
80
|
-
- lib/relaton_iana/config.rb
|
81
80
|
- lib/relaton_iana/data_fetcher.rb
|
82
81
|
- lib/relaton_iana/hash_converter.rb
|
83
82
|
- lib/relaton_iana/iana_bibliographic_item.rb
|
@@ -108,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
107
|
- !ruby/object:Gem::Version
|
109
108
|
version: '0'
|
110
109
|
requirements: []
|
111
|
-
rubygems_version: 3.3.
|
110
|
+
rubygems_version: 3.3.27
|
112
111
|
signing_key:
|
113
112
|
specification_version: 4
|
114
113
|
summary: 'RelatonIana: Ruby XMLDOC impementation.'
|