relaton-iana 1.12.2 → 1.12.5

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: b17cfe89413628f312b5d69d1ee7539f55aa7ba4e88c2e0729f1517e1030365b
4
- data.tar.gz: c83f92105be665ff44fb6b88f4f7d679de8707f07d9b09d2d3a4007de2757169
3
+ metadata.gz: f252aaed0f38fd807bb42f46e68e6711a550d3ae3bedf8b3c1d5be678de559fb
4
+ data.tar.gz: e330cfa8122d9248b251826e4384e13f8980c7006bfc6dfd4e51ff849747d12b
5
5
  SHA512:
6
- metadata.gz: 508171828c519bd0193451cf019b653878c02cef79316406f096c7738b8ccb9bee35ff4089823916544286ad3c2fdf9a2ff8ae06afbb2d09b2fa89848cdafa00
7
- data.tar.gz: 03a8be0948cbe9f42d33a22fcce1668c9fe6f850e4cae9593663939686c06064593a259d3cf0b6e4303d9f22f00ca71697e5330d1caeaa6c73b203aa13d9d796
6
+ metadata.gz: 2f9f6474c8a94b2a4f7f13a65a7bcf4fa16ccdd13d86623b8eecf42f719d2f6f69feb0daf448a8aa65a1f0a9819498a5b23a880a4de3b057d88114ac54f55e98
7
+ data.tar.gz: 186707bedaa38b15cd2bdd0d53ed0c498c0b2815135f169ac432a7460cb397e488c7c1fc0613cec7cc8b44c565d55fb37004e346d9bf4a6f1d7867720f839c2e
@@ -38,7 +38,7 @@ module RelatonIana
38
38
  #
39
39
  def fetch(page = 1) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
40
40
  params = {
41
- q: "repo:ietf-ribose/iana-registries extension:xml",
41
+ q: "repo:ietf-tools/iana-registries extension:xml",
42
42
  page: page, per_page: 100
43
43
  }
44
44
  if ENV["GITHUB_TOKEN"]
@@ -46,10 +46,14 @@ module RelatonIana
46
46
  end
47
47
  attempt = 0
48
48
  json = {}
49
+ resp = nil
49
50
  until attempt > 3 || json["items"]
50
51
  if attempt.positive?
51
- warn "Rate limit is reached. Retrying in 30 sec."
52
- sleep 30
52
+ t = resp.headers["x-ratelimit-reset"].to_i - Time.now.to_i
53
+ if t.positive?
54
+ warn "Rate limit is reached. Retrying in #{t} sec."
55
+ sleep t
56
+ end
53
57
  end
54
58
  attempt += 1
55
59
  resp = Faraday.get "https://api.github.com/search/code", params, headers
@@ -11,6 +11,8 @@ module RelatonIana
11
11
  file = text.sub(/^IANA\s/, "").gsub(/[\s,:\/]/, "_").downcase
12
12
  url = "#{SOURCE}#{file}.yaml"
13
13
  resp = Net::HTTP.get_response URI(url)
14
+ return unless resp.code == "200"
15
+
14
16
  hash = YAML.safe_load resp.body
15
17
  RelatonBib::BibliographicItem.from_hash hash
16
18
  rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIana
4
- VERSION = "1.12.2"
4
+ VERSION = "1.12.5"
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.12.2
4
+ version: 1.12.5
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-07-01 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml