relaton-iana 1.10.0 → 1.10.3

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: a41288196149a3d6f5b68a4c287eb88978e6eee3a815977e26873dd0c7c3c259
4
- data.tar.gz: bfeaafe8a9030f92a3a4add4055609a3da26b29b7a5dab9c858a48190ce98bbe
3
+ metadata.gz: 07dca594168e40a1f9b5812a3cb91d32cd5efbb6327f4c7655e85380be82c321
4
+ data.tar.gz: 00c289707dce23f54bb94bc051a07551c36d31f3df3c692aadc2a3c281246bd6
5
5
  SHA512:
6
- metadata.gz: 8c5aee738b7a75b0c9a0f28b7d59d245ee3affe5e32d58aa54fd35cf8097984abda776ee2a17496dee8a25504a992359ad9ea2ce968a922a8552c154a55a8532
7
- data.tar.gz: 92e282194839e2a0e48ab0bfb2f1aa401374939497f467cc41868b2d81f1adb69fbe278a932c03af01a212180e2c68ef582bd8343e5e6c33d79be07a5184bd8a
6
+ metadata.gz: a8750c77386f980a59ad16b982876bd53961cbee0f2e4e13851b05d77b6b20495fa8f8588a6907ecd2d43bf34a768ff4e6c08751a1f02022248059b4f2e265e1
7
+ data.tar.gz: b4b5f25d6863e539421911ffc1330c2057b6f8c5a78bff06ba5ee66c128a90f395de3bc8efa92053f9ab173974514aa603b31f1a2694b34efd13081d8c07dd4d
data/grammars/biblio.rng CHANGED
@@ -209,9 +209,6 @@
209
209
  <zeroOrMore>
210
210
  <ref name="contact"/>
211
211
  </zeroOrMore>
212
- <zeroOrMore>
213
- <ref name="uri"/>
214
- </zeroOrMore>
215
212
  </element>
216
213
  </define>
217
214
  <define name="fullname">
@@ -828,6 +825,11 @@
828
825
  <optional>
829
826
  <attribute name="scope"/>
830
827
  </optional>
828
+ <optional>
829
+ <attribute name="primary">
830
+ <data type="boolean"/>
831
+ </attribute>
832
+ </optional>
831
833
  <text/>
832
834
  </element>
833
835
  </define>
@@ -1,6 +1,6 @@
1
1
  module RelatonIana
2
2
  class DataFetcher
3
- SOURCE = "https://raw.githubusercontent.com/ietf-ribose/iana-registries/main/"
3
+ SOURCE = "https://raw.githubusercontent.com/ietf-ribose/iana-registries/main/".freeze
4
4
 
5
5
  #
6
6
  # Data fetcher initializer
@@ -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)]
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.0"
4
+ VERSION = "1.10.3"
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.0"
42
+ spec.add_dependency "relaton-bib", "~> 1.10.1"
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.0
4
+ version: 1.10.3
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-01-30 00:00:00.000000000 Z
11
+ date: 2022-03-24 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.0
145
+ version: 1.10.1
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.0
152
+ version: 1.10.1
153
153
  description: 'RelatonIana: Ruby XMLDOC impementation.'
154
154
  email:
155
155
  - open.source@ribose.com