relaton-ietf 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/relaton_ietf/scrapper.rb +12 -3
- 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: 434453b0dde2f07fcfb578e3ef63a7bdd1295ffd7ef69030e361920ccf97c60f
|
4
|
+
data.tar.gz: 5eb7911905fc0ecd2edf822029580b0545b5a2a223cc914815ca6c5b28a6630b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4c73b06add12b2d2db70da5d5fe0c45f9a93efba60465b9ed4ae397bf0338c02e93afdff83c926e08aed10793b7b5ae37fd49caa1abe653f45b98bbac221815
|
7
|
+
data.tar.gz: 6f87bc69748909c8e93453de5c2a89cae15e7f35946f584158bcbcded4dbb0ae6bce999ac3c6122fd599617c2f77dea640fb200c46272479b48138a069c75908
|
data/Gemfile.lock
CHANGED
@@ -38,8 +38,10 @@ module RelatonIetf
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# @param reference [String]
|
41
|
+
# @param is_relation [TrueClass, FalseClass]
|
42
|
+
# @param url [String, NilClass]
|
41
43
|
# @return [RelatonIetf::IetfBibliographicItem]
|
42
|
-
def fetch_rfc(reference, is_relation = false)
|
44
|
+
def fetch_rfc(reference, is_relation = false, url = nil)
|
43
45
|
return unless reference
|
44
46
|
|
45
47
|
ietf_item(
|
@@ -48,7 +50,7 @@ module RelatonIetf
|
|
48
50
|
docid: docids(reference),
|
49
51
|
status: status(reference),
|
50
52
|
language: [language(reference)],
|
51
|
-
link:
|
53
|
+
link: link(reference, url),
|
52
54
|
title: titles(reference),
|
53
55
|
abstract: abstracts(reference),
|
54
56
|
contributor: contributors(reference),
|
@@ -61,6 +63,13 @@ module RelatonIetf
|
|
61
63
|
|
62
64
|
private
|
63
65
|
|
66
|
+
def link(reference, url)
|
67
|
+
l = []
|
68
|
+
l << { type: "xml", content: url } if url
|
69
|
+
l << { type: "src", content: reference[:target] } if reference[:target]
|
70
|
+
l
|
71
|
+
end
|
72
|
+
|
64
73
|
# @param attrs [Hash]
|
65
74
|
# @return [RelatonIetf::IetfBibliographicItem]
|
66
75
|
def ietf_item(**attrs)
|
@@ -76,7 +85,7 @@ module RelatonIetf
|
|
76
85
|
def rfc_item(uri_template, ref, is_relation)
|
77
86
|
uri = uri_template.sub "CODE", ref.sub(/\s|\u00a0/, ".") + ".xml"
|
78
87
|
doc = Nokogiri::XML get_page(uri)
|
79
|
-
fetch_rfc doc.at("//reference"), is_relation
|
88
|
+
fetch_rfc doc.at("//reference"), is_relation, uri
|
80
89
|
end
|
81
90
|
|
82
91
|
# @param uri_template [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: 0.6.
|
4
|
+
version: 0.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|