Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit 510599b

Browse files
author
Andy Newton
committed
added webmock to fix #29
1 parent da7a83a commit 510599b

File tree

6 files changed

+2060
-2
lines changed

6 files changed

+2060
-2
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ gem 'netaddr'
33
gem 'rspec', :require => false, :group => :test
44
gem 'simplecov', :require => false, :group => :test
55
gem 'rake', :require => false, :group => :test
6+
gem 'webmock', :require => false, :group => :test
7+

Gemfile.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4+
addressable (2.5.2)
5+
public_suffix (>= 2.0.2, < 4.0)
6+
crack (0.4.3)
7+
safe_yaml (~> 1.0.0)
48
diff-lcs (1.3)
59
docile (1.1.5)
10+
hashdiff (0.3.7)
611
json (2.1.0)
712
netaddr (1.5.1)
13+
public_suffix (3.0.1)
814
rake (12.1.0)
915
rspec (3.7.0)
1016
rspec-core (~> 3.7.0)
@@ -19,11 +25,16 @@ GEM
1925
diff-lcs (>= 1.2.0, < 2.0)
2026
rspec-support (~> 3.7.0)
2127
rspec-support (3.7.0)
28+
safe_yaml (1.0.4)
2229
simplecov (0.15.1)
2330
docile (~> 1.1.0)
2431
json (>= 1.8, < 3)
2532
simplecov-html (~> 0.10.0)
2633
simplecov-html (0.10.2)
34+
webmock (3.1.1)
35+
addressable (>= 2.3.6)
36+
crack (>= 0.3.2)
37+
hashdiff
2738

2839
PLATFORMS
2940
ruby
@@ -33,6 +44,7 @@ DEPENDENCIES
3344
rake
3445
rspec
3546
simplecov
47+
webmock
3648

3749
BUNDLED WITH
3850
1.15.4

lib/nicinfo/nicinfo_main.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,13 +500,14 @@ def run
500500
end
501501
else
502502
json_data = do_rdap_query
503-
display_rdap_query( json_data, true )
503+
display_rdap_query( json_data, true ) if json_data
504504
end
505505

506506

507507
end
508508

509509
def do_rdap_query
510+
retval = nil
510511
if @config.config[ NicInfo::BOOTSTRAP ][ NicInfo::BOOTSTRAP_URL ] == nil && !@config.options.url
511512
bootstrap = Bootstrap.new( @config )
512513
qtype = @config.options.query_type
@@ -564,7 +565,7 @@ def do_rdap_query
564565
end
565566
inspect_rdap_compliance json_data
566567
cache_self_references json_data
567-
json_data
568+
retval = json_data
568569
rescue JSON::ParserError => a
569570
@config.logger.mesg( "Server returned invalid JSON!" )
570571
rescue SocketError => a
@@ -603,6 +604,7 @@ def do_rdap_query
603604
end
604605
@config.logger.trace("Server response code was " + e.response.code)
605606
end
607+
return retval
606608
end
607609

608610
def display_rdap_query json_data, show_help = true

0 commit comments

Comments
 (0)