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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0110d176356d3095e2786d49f7d9c4614bdfb19e29f22d7bf6b6c6a4f9c98ad2
4
- data.tar.gz: 452ff68e683d02e65409dc3ddb7cf1444d2e39d1f7e6de5822dad884445a8d37
3
+ metadata.gz: 434453b0dde2f07fcfb578e3ef63a7bdd1295ffd7ef69030e361920ccf97c60f
4
+ data.tar.gz: 5eb7911905fc0ecd2edf822029580b0545b5a2a223cc914815ca6c5b28a6630b
5
5
  SHA512:
6
- metadata.gz: d335b0e3d7ae6eae3a937a6253ef68468bbaa1fe0a53ecc90b3c01d8b3261c2d9a04fa1be3c04114bd8246da99f12a32a07f31f084fca38b5945461c51dea7b5
7
- data.tar.gz: f7c3771ec1f7c44c86a72347119ff906d608aedae29ecbff73af2ea07d6fae06128dffca4356c090e038b20f922dbbc53875ea0ddb9fe9b1039abc34d6249ae3
6
+ metadata.gz: a4c73b06add12b2d2db70da5d5fe0c45f9a93efba60465b9ed4ae397bf0338c02e93afdff83c926e08aed10793b7b5ae37fd49caa1abe653f45b98bbac221815
7
+ data.tar.gz: 6f87bc69748909c8e93453de5c2a89cae15e7f35946f584158bcbcded4dbb0ae6bce999ac3c6122fd599617c2f77dea640fb200c46272479b48138a069c75908
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton-ietf (0.6.8)
4
+ relaton-ietf (0.6.9)
5
5
  relaton-bib (~> 0.3.0)
6
6
 
7
7
  GEM
@@ -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: [{ type: "src", content: reference[:target] }],
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]
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "0.6.8".freeze
2
+ VERSION = "0.6.9".freeze
3
3
  end
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.8
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-10-31 00:00:00.000000000 Z
11
+ date: 2019-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler