relaton-ietf 1.11.0 → 1.11.1

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: 487865677406ccb87b65d3f4064c60bef7d26b7955817dd7030c4272eabf3e3f
4
- data.tar.gz: 818d190f6bcb3d91a9b5a0bf7ebe8e5acd20e3f1e46de30c1b7e6e9b4435116b
3
+ metadata.gz: 7812c81b9dd19179ee160ebc6ab9f8d8388339c63eaeb58dc7e63438bc1732e6
4
+ data.tar.gz: d8451d7aff8ab646b026a8a236c51980792896cb2c8892f21b7dacf061e2e8a9
5
5
  SHA512:
6
- metadata.gz: 1f2553900686f5c7a1a3653b0e9546510448e79dde9965d8c1aa604377bde3489d805bdd13ae68128bfa7f49fd4037d588584c3dcc3ca594579f5410c6cb0b6e
7
- data.tar.gz: 1a0599db3efa91cfd7360f53cc77bffdb1fcf7b445f2fc56e9d2957634826adf71be8c54a75e71e2b5e4619e91c00d7b351b01eb01c16535be2c3602281ba45d
6
+ metadata.gz: a135ae22b557666d392f7e7b29612c8338e21f844f2f484c1f8772208e5ad2e635898b3c9bc6b5fdef372a6ab6a1df710844b245c7d7835c137334f57190a877
7
+ data.tar.gz: 9f04a36d7c1ce3ac3f9f9867ac8739f334484d847ff6e7fded8da8015334a6dbeb691b64f866ac37c2b04060f7f3e98896e73b652f9030b30fe15b8c88f4a242
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
- Encoding.default_external = Encoding::UTF_8
2
- Encoding.default_internal = Encoding::UTF_8
3
-
4
1
  source "https://rubygems.org"
5
2
 
6
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
@@ -3,12 +3,13 @@ module RelatonIetf
3
3
  #
4
4
  # Document parser initalization
5
5
  #
6
- # @param [String] name document type name
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(name, doc_id, is_also)
11
- @name = name
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
- name = doc.name.split("-").first
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
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "1.11.0".freeze
2
+ VERSION = "1.11.1".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: 1.11.0
4
+ version: 1.11.1
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-04-10 00:00:00.000000000 Z
11
+ date: 2022-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml