relaton-ietf 1.11.0 → 1.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -3
- data/lib/relaton_ietf/data_fetcher.rb +8 -2
- data/lib/relaton_ietf/rfc_index_entry.rb +8 -6
- data/lib/relaton_ietf/scrapper.rb +1 -1
- data/lib/relaton_ietf/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: 53c7e68edafd4a51e8b08f0b169318d1864a0fba32327f9ceaf2eb7968048c97
|
4
|
+
data.tar.gz: 8b75d635bbc3e97c9cb7a680ed0c657d50614a5313babe1ac5759dd0e1c584c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcdaea6abeb068ad1a23bd9e2ba3f5792c1eeccd06b90586f8307aa005f3204f6cd135ac96b38b5ac60a1a38e70980ec3ff3163255eb5b79254f60bba8be9732
|
7
|
+
data.tar.gz: 2f2ce84d3898691e786fc598963842f68e36ea0ee2a9ee179d131d00ab1ce724860938e40caedbb4cf06adf1cafceffdbd9109e481ae8142453f804c80349088
|
data/Gemfile
CHANGED
@@ -63,13 +63,19 @@ module RelatonIetf
|
|
63
63
|
#
|
64
64
|
# Fetches ietf-internet-drafts documents
|
65
65
|
#
|
66
|
-
def fetch_ieft_internet_drafts # rubocop:disable Metrics/MethodLength
|
66
|
+
def fetch_ieft_internet_drafts # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
67
67
|
versions = Dir["bibxml-ids/*.xml"].each_with_object([]) do |path, vers|
|
68
68
|
file = File.basename path, ".xml"
|
69
69
|
if file.include?("D.draft-")
|
70
70
|
vers << file.sub(/^reference\.I-D\./, "")
|
71
|
+
/(?<ver>\d+)$/ =~ file
|
71
72
|
end
|
72
|
-
|
73
|
+
bib = BibXMLParser.parse(File.read(path, encoding: "UTF-8"))
|
74
|
+
if ver
|
75
|
+
version = RelatonBib::BibliographicItem::Version.new nil, [ver]
|
76
|
+
bib.instance_variable_set :@version, version
|
77
|
+
end
|
78
|
+
save_doc bib
|
73
79
|
end
|
74
80
|
update_versions(versions) if versions.any? && @format != "bibxml"
|
75
81
|
end
|
@@ -3,12 +3,13 @@ module RelatonIetf
|
|
3
3
|
#
|
4
4
|
# Document parser initalization
|
5
5
|
#
|
6
|
-
# @param [
|
6
|
+
# @param [Nokogiri::XML::Element] doc document
|
7
7
|
# @param [String] doc_id document id
|
8
8
|
# @param [Array<String>] is_also included document ids
|
9
9
|
#
|
10
|
-
def initialize(
|
11
|
-
@
|
10
|
+
def initialize(doc, doc_id, is_also)
|
11
|
+
@doc = doc
|
12
|
+
@name = doc.name.split("-").first
|
12
13
|
@shortnum = doc_id[-4..-1].sub(/^0+/, "")
|
13
14
|
@doc_id = doc_id
|
14
15
|
@is_also = is_also
|
@@ -26,8 +27,7 @@ module RelatonIetf
|
|
26
27
|
is_also = doc.xpath("./xmlns:is-also/xmlns:doc-id").map &:text
|
27
28
|
return unless doc_id && is_also.any?
|
28
29
|
|
29
|
-
|
30
|
-
new(name, doc_id.text, is_also).parse
|
30
|
+
new(doc, doc_id.text, is_also).parse
|
31
31
|
end
|
32
32
|
|
33
33
|
def parse
|
@@ -79,7 +79,9 @@ module RelatonIetf
|
|
79
79
|
|
80
80
|
def parse_relation
|
81
81
|
@is_also.each_with_object([]) do |ref, a|
|
82
|
-
bib = IetfBibliography.get ref.sub(/^(RFC)(\d+)/, '\1 \2')
|
82
|
+
# bib = IetfBibliography.get ref.sub(/^(RFC)(\d+)/, '\1 \2')
|
83
|
+
ref_doc = @doc.at "/xmlns:rfc-index/xmlns:rfc-entry[xmlns:doc-id[text()='#{ref}']]"
|
84
|
+
bib = RfcEntry.parse ref_doc
|
83
85
|
a << { type: "includes", bibitem: bib } if bib
|
84
86
|
end
|
85
87
|
end
|
@@ -38,7 +38,7 @@ module RelatonIetf
|
|
38
38
|
# doc = Nokogiri::XML get_page(uri)
|
39
39
|
# r = doc.at("/referencegroup", "/reference")
|
40
40
|
# fetch_rfc r, is_relation: is_relation, url: uri, ver: ver
|
41
|
-
BibXMLParser.parse get_page(uri),
|
41
|
+
BibXMLParser.parse get_page(uri), is_relation: is_relation, ver: ver
|
42
42
|
end
|
43
43
|
|
44
44
|
# @param uri [String]
|
data/lib/relaton_ietf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ietf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.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-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|