relaton-iana 1.10.2 → 1.10.3

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: 93e0a12e1423e347f98915fa071ccf958d870ed3a817fcd5b673701a2b6b9ab5
4
- data.tar.gz: 2783725c1162b4c8469a6d6300c60949d4e38a743e30a3c8cc97558f749e587a
3
+ metadata.gz: 07dca594168e40a1f9b5812a3cb91d32cd5efbb6327f4c7655e85380be82c321
4
+ data.tar.gz: 00c289707dce23f54bb94bc051a07551c36d31f3df3c692aadc2a3c281246bd6
5
5
  SHA512:
6
- metadata.gz: 373396d87b8d22be19db8f14ce375494711177e0334746b81f009bfd15a87134aa90d103dc1e42c196304f0d6d0a3aba01a2d3a1228c685b32822899de61465b
7
- data.tar.gz: 7dcb797254dab8c825a1974ec4f8205407239df6932690d4039e9bb7b18c0cda1b3f8127c4e5c4b911c809047e20061404a1dd3fe619e3a24f5501b806826a28
6
+ metadata.gz: a8750c77386f980a59ad16b982876bd53961cbee0f2e4e13851b05d77b6b20495fa8f8588a6907ecd2d43bf34a768ff4e6c08751a1f02022248059b4f2e265e1
7
+ data.tar.gz: b4b5f25d6863e539421911ffc1330c2057b6f8c5a78bff06ba5ee66c128a90f395de3bc8efa92053f9ab173974514aa603b31f1a2694b34efd13081d8c07dd4d
@@ -34,6 +34,8 @@ module RelatonIana
34
34
  #
35
35
  # Parse documents
36
36
  #
37
+ # @param [Integer] page page number
38
+ #
37
39
  def fetch(page = 1) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
38
40
  params = {
39
41
  q: "repo:ietf-ribose/iana-registries extension:xml",
@@ -61,6 +63,11 @@ module RelatonIana
61
63
  fetch(page + 1) if (json["total_count"] - (page * 100)).positive?
62
64
  end
63
65
 
66
+ #
67
+ # Fetch document
68
+ #
69
+ # @param [String] url url of document
70
+ #
64
71
  def fetch_doc(url) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
65
72
  resp = Net::HTTP.get_response URI(url)
66
73
  if resp.code == "200"
@@ -75,10 +75,19 @@ module RelatonIana
75
75
  def parse_docid
76
76
  [
77
77
  RelatonBib::DocumentIdentifier.new(type: "IANA", id: pub_id, primary: true),
78
- RelatonBib::DocumentIdentifier.new(type: "IANA", id: docnumber.upcase, scope: "anchor"),
78
+ RelatonBib::DocumentIdentifier.new(type: "IETF", id: anchor, scope: "anchor"),
79
79
  ]
80
80
  end
81
81
 
82
+ #
83
+ # Create anchor
84
+ #
85
+ # @return [String] anchor
86
+ #
87
+ def anchor
88
+ docnumber.upcase.gsub("/", "__")
89
+ end
90
+
82
91
  #
83
92
  # Generate PubID
84
93
  #
@@ -88,6 +97,11 @@ module RelatonIana
88
97
  "IANA #{docnumber}"
89
98
  end
90
99
 
100
+ #
101
+ # Create docnumber
102
+ #
103
+ # @return [String] docnumber
104
+ #
91
105
  def docnumber
92
106
  dn = ""
93
107
  dn += "#{@rootdoc.docnumber}/" if @rootdoc
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIana
4
- VERSION = "1.10.2"
4
+ VERSION = "1.10.3"
5
5
  end
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.10.2
4
+ version: 1.10.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-03-22 00:00:00.000000000 Z
11
+ date: 2022-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml