relaton-iana 1.10.2 → 1.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_iana/data_fetcher.rb +7 -0
- data/lib/relaton_iana/parser.rb +15 -1
- data/lib/relaton_iana/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07dca594168e40a1f9b5812a3cb91d32cd5efbb6327f4c7655e85380be82c321
|
4
|
+
data.tar.gz: 00c289707dce23f54bb94bc051a07551c36d31f3df3c692aadc2a3c281246bd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8750c77386f980a59ad16b982876bd53961cbee0f2e4e13851b05d77b6b20495fa8f8588a6907ecd2d43bf34a768ff4e6c08751a1f02022248059b4f2e265e1
|
7
|
+
data.tar.gz: b4b5f25d6863e539421911ffc1330c2057b6f8c5a78bff06ba5ee66c128a90f395de3bc8efa92053f9ab173974514aa603b31f1a2694b34efd13081d8c07dd4d
|
@@ -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"
|
data/lib/relaton_iana/parser.rb
CHANGED
@@ -75,10 +75,19 @@ module RelatonIana
|
|
75
75
|
def parse_docid
|
76
76
|
[
|
77
77
|
RelatonBib::DocumentIdentifier.new(type: "IANA", id: pub_id, primary: true),
|
78
|
-
RelatonBib::DocumentIdentifier.new(type: "
|
78
|
+
RelatonBib::DocumentIdentifier.new(type: "IETF", id: anchor, scope: "anchor"),
|
79
79
|
]
|
80
80
|
end
|
81
81
|
|
82
|
+
#
|
83
|
+
# Create anchor
|
84
|
+
#
|
85
|
+
# @return [String] anchor
|
86
|
+
#
|
87
|
+
def anchor
|
88
|
+
docnumber.upcase.gsub("/", "__")
|
89
|
+
end
|
90
|
+
|
82
91
|
#
|
83
92
|
# Generate PubID
|
84
93
|
#
|
@@ -88,6 +97,11 @@ module RelatonIana
|
|
88
97
|
"IANA #{docnumber}"
|
89
98
|
end
|
90
99
|
|
100
|
+
#
|
101
|
+
# Create docnumber
|
102
|
+
#
|
103
|
+
# @return [String] docnumber
|
104
|
+
#
|
91
105
|
def docnumber
|
92
106
|
dn = ""
|
93
107
|
dn += "#{@rootdoc.docnumber}/" if @rootdoc
|
data/lib/relaton_iana/version.rb
CHANGED
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.
|
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-03-
|
11
|
+
date: 2022-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|