rdap 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -2
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +12 -0
  5. data/README.md +2 -1
  6. data/lib/rdap.rb +4 -1
  7. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a812f4f58d5435ffd4a7b6d85d0373b1d7eb7914fb87854f48f2142009ff0f3f
4
- data.tar.gz: f039922723968ba123c0697e5254e07220bce7a85015f2783bcaca17f2c87e37
3
+ metadata.gz: 37097088b19ddfd4d65ce6d2968da8b6096920134246a8c9ec9277167f80e1be
4
+ data.tar.gz: 48422426b1fbd15c7a69c6f4b72cda5588a6983e737b9a687311154e6475f1ca
5
5
  SHA512:
6
- metadata.gz: d3fdb2df158c5a13d0a479fba0760e766c12f707cb82bb4214f7e9e95629d84700ab788d7b2591233367862b3f79e2f8eb34fa44a13fb8bfecdecde83f6d164b
7
- data.tar.gz: 3a2219bfb23a0fa4e3a3204db935024b6a2ec2f733f57e5541fec37b3e917c41cd54231f418d91f5bf30e12bbccd4ac2f5b68a5d8ac001ba12d07e03e3ae3c32
6
+ metadata.gz: b2952f430513e86e4b35d48c4b90246ba53ff279053043caa15822513a462079e468d09872c4db42fe3ad3e79383f22db550301b758b09af0ec86a2577700bf3
7
+ data.tar.gz: 8b5a306cccb1972ad7d530d8b53ea97c6656f455e80436559a46460b1634d177f3706a4f9bd7ae7f545fea0ece6c7345fe7148803848e37997a4a74577589990
data/.travis.yml CHANGED
@@ -1,9 +1,11 @@
1
1
  ---
2
2
  language: ruby
3
3
  cache: bundler
4
+ # Ubuntu 18.04
5
+ dist: bionic
6
+ # https://docs.travis-ci.com/user/reference/bionic/#ruby-support
4
7
  rvm:
5
- - 2.5.7
6
8
  - 2.6.5
7
- - 2.7.5
9
+ - 2.7.0
8
10
  - 3.0.3
9
11
  before_install: gem install bundler -v 2.1.4
data/Gemfile CHANGED
@@ -6,3 +6,4 @@ gemspec
6
6
  gem "rake", ">= 12.0"
7
7
  gem "rspec", "~> 3.0"
8
8
  gem "vcr", "~> 6.0"
9
+ gem "webmock"
data/Gemfile.lock CHANGED
@@ -6,8 +6,15 @@ PATH
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ addressable (2.8.0)
10
+ public_suffix (>= 2.0.2, < 5.0)
11
+ crack (0.4.5)
12
+ rexml
9
13
  diff-lcs (1.4.4)
14
+ hashdiff (1.0.1)
15
+ public_suffix (4.0.6)
10
16
  rake (13.0.6)
17
+ rexml (3.2.5)
11
18
  rspec (3.10.0)
12
19
  rspec-core (~> 3.10.0)
13
20
  rspec-expectations (~> 3.10.0)
@@ -22,6 +29,10 @@ GEM
22
29
  rspec-support (~> 3.10.0)
23
30
  rspec-support (3.10.3)
24
31
  vcr (6.0.0)
32
+ webmock (3.14.0)
33
+ addressable (>= 2.8.0)
34
+ crack (>= 0.3.2)
35
+ hashdiff (>= 0.4.0, < 2.0.0)
25
36
 
26
37
  PLATFORMS
27
38
  ruby
@@ -31,6 +42,7 @@ DEPENDENCIES
31
42
  rdap!
32
43
  rspec (~> 3.0)
33
44
  vcr (~> 6.0)
45
+ webmock
34
46
 
35
47
  BUNDLED WITH
36
48
  2.1.4
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # RDAP
1
+ # RDAP [![Build Status](https://app.travis-ci.com/jarthod/rdap.svg?branch=master)](https://app.travis-ci.com/github/jarthod/rdap)
2
2
 
3
3
  A minimal Ruby client to query RDAP APIs though a bootstrap server.
4
4
  No dependencies, no caching or bootstrap file (the query is routed through a bootstrap server first).
@@ -83,6 +83,7 @@ The gem make a query to one of the publicly available RDAP bootstrap server (the
83
83
 
84
84
  ## Changelog
85
85
 
86
+ **0.1.1** (2021-12-19) - Added TooManyRequests expection in case of 429
86
87
  **0.1.0** (2021-12-17) - Initial version
87
88
 
88
89
  ## Contributing
data/lib/rdap.rb CHANGED
@@ -2,13 +2,14 @@ require 'json'
2
2
  require 'net/http'
3
3
 
4
4
  module RDAP
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  BOOTSTRAP = "https://rdap.org/"
7
7
  TYPES = [:domain, :ip, :autnum]
8
8
 
9
9
  class Error < StandardError; end
10
10
  class ServerError < Error; end
11
11
  class NotFound < Error; end
12
+ class TooManyRequests < Error; end
12
13
 
13
14
  def self.domain name, **opts
14
15
  query name, type: :domain, **opts
@@ -54,6 +55,8 @@ module RDAP
54
55
  else
55
56
  raise NotFound.new("[#{response.code}] #{response.message}")
56
57
  end
58
+ when Net::HTTPTooManyRequests
59
+ raise TooManyRequests.new("[#{response.code}] #{response.message}")
57
60
  when Net::HTTPRedirection
58
61
  get_follow_redirects(URI(response["location"]), timeout: timeout, redirection_limit: redirection_limit - 1)
59
62
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Rey-Jarthon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-17 00:00:00.000000000 Z
11
+ date: 2021-12-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: