relaton-iana 1.12.0 → 1.12.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 +3 -3
- data/lib/relaton_iana/iana_bibliography.rb +1 -1
- data/lib/relaton_iana/parser.rb +2 -4
- 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: 2f83f06a1729e6bdd28bd55a53e38c3569af02f21688df68237a2c8e57f8ea40
|
4
|
+
data.tar.gz: 461d3ec1a68a95a78e91448f9975d6973deeb0260e1a1590d1299ab04f1d3d01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fe87f10e54798f20bb6a51a28911df61170b1593a4b3b915c964586cc74345bffae6c3710762e5c1b8158be520de5b82dcb5ec5b6627f9cd260c54aba00cf9c
|
7
|
+
data.tar.gz: '08857ab11716d87e77c96909370861a03bf6139aebdc88fa77f8ec4712e62b5a241d87fd53ada0265a692e4d76c67f75947ef950a84c03e7eddfe4bc177e973c'
|
@@ -24,7 +24,7 @@ module RelatonIana
|
|
24
24
|
def self.fetch(output: "data", format: "yaml")
|
25
25
|
t1 = Time.now
|
26
26
|
puts "Started at: #{t1}"
|
27
|
-
FileUtils.mkdir_p output
|
27
|
+
FileUtils.mkdir_p output
|
28
28
|
new(output, format).fetch
|
29
29
|
t2 = Time.now
|
30
30
|
puts "Stopped at: #{t2}"
|
@@ -38,7 +38,7 @@ module RelatonIana
|
|
38
38
|
#
|
39
39
|
def fetch(page = 1) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
40
40
|
params = {
|
41
|
-
q: "repo:ietf-
|
41
|
+
q: "repo:ietf-tools/iana-registries extension:xml",
|
42
42
|
page: page, per_page: 100
|
43
43
|
}
|
44
44
|
if ENV["GITHUB_TOKEN"]
|
@@ -115,7 +115,7 @@ module RelatonIana
|
|
115
115
|
# @return [String] file name
|
116
116
|
#
|
117
117
|
def file_name(bib)
|
118
|
-
name = bib.docnumber.gsub(/[\s,:\/]/, "_").squeeze("_")
|
118
|
+
name = bib.docnumber.downcase.gsub(/[\s,:\/]/, "_").squeeze("_")
|
119
119
|
File.join @output, "#{name}.#{@ext}"
|
120
120
|
end
|
121
121
|
end
|
@@ -8,7 +8,7 @@ module RelatonIana
|
|
8
8
|
# @param text [String]
|
9
9
|
# @return [RelatonBib::BibliographicItem]
|
10
10
|
def search(text) # rubocop:disable Metrics/MethodLength
|
11
|
-
file = text.sub(/^IANA\s/, "").gsub(/[\s,:\/]/, "_")
|
11
|
+
file = text.sub(/^IANA\s/, "").gsub(/[\s,:\/]/, "_").downcase
|
12
12
|
url = "#{SOURCE}#{file}.yaml"
|
13
13
|
resp = Net::HTTP.get_response URI(url)
|
14
14
|
hash = YAML.safe_load resp.body
|
data/lib/relaton_iana/parser.rb
CHANGED
@@ -37,7 +37,7 @@ module RelatonIana
|
|
37
37
|
title: parse_title,
|
38
38
|
link: parse_link,
|
39
39
|
docid: parse_docid,
|
40
|
-
docnumber:
|
40
|
+
docnumber: docnumber,
|
41
41
|
date: parse_date,
|
42
42
|
contributor: contributor,
|
43
43
|
)
|
@@ -73,9 +73,7 @@ module RelatonIana
|
|
73
73
|
# @return [Arra<RelatonBib::DocumentIdentifier>] docidentifier
|
74
74
|
#
|
75
75
|
def parse_docid
|
76
|
-
[
|
77
|
-
RelatonBib::DocumentIdentifier.new(type: "IANA", id: pub_id, primary: true),
|
78
|
-
]
|
76
|
+
[RelatonBib::DocumentIdentifier.new(type: "IANA", id: pub_id, primary: true)]
|
79
77
|
end
|
80
78
|
|
81
79
|
#
|
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.12.
|
4
|
+
version: 1.12.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-
|
11
|
+
date: 2022-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|