nicinfo 1.5.0 → 1.5.2

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: 7ecaa53b9df142ebd216e7dc88de56ab2f811c4339e9f075c4088f26d5cecd83
4
- data.tar.gz: af818b3b4a62989a1a4b4f8379601ca184461ad6483361070ac22a021ad83b18
3
+ metadata.gz: a5c7dd83e6986963ce8a7a96ae9496380c99373ce8ddf1f6a7682d03a2176666
4
+ data.tar.gz: 41d3c6eea245eb4f1840f11a8087e36296dac20a0411d97ed85a71f82c3d9c83
5
5
  SHA512:
6
- metadata.gz: 035ad570ca83474c8a2256ca0107507322aacdd7987cdde9c63332158e2cb59f1c2e100d30e384648b711a2e73e77a3d3a36a1e6e65789de74a4154557e23610
7
- data.tar.gz: 3d10ed8e6f05f03b7d6b2124e831e30e7684a7b505791265db4170ad117f574e4a53977aa8e0ed1abd97fef7f33cdee8f819ac620eaba06e1d4e3adb6a908047
6
+ metadata.gz: 1209474b809179649f5f213d3a1c8ab85730db92fbbd5008da7824c378788a5d08976458b8f7cf817e1c28e75626f6aef7b79a148e58c406cc1bc568adeed716
7
+ data.tar.gz: f16490223d30358b4091fbe49d4c0f8a70afc30f196ab4b416bf95e3e22a33d458565fdc38b36584e0ff1ef0db8ec3cd6506f909cf0920c8f18a26781140bddc
@@ -131,7 +131,7 @@ module NicInfo
131
131
  def get_bsfiles_last_update_time
132
132
  retval = nil
133
133
  fname = bsfiles_last_update_filename
134
- if File.exists?( fname )
134
+ if File.exist?( fname )
135
135
  f = File.open( fname, "r" )
136
136
  data = f.read
137
137
  f.close
@@ -185,7 +185,7 @@ module NicInfo
185
185
  def load_as_yaml name, default = nil
186
186
  file_name = make_file_name( name )
187
187
  retval = default
188
- if File.exists?( file_name )
188
+ if File.exist?( file_name )
189
189
  data_file = File.open( File.join( @app_data, name ), "r" )
190
190
  retval = YAML::load( data_file )
191
191
  data_file.close
@@ -18,7 +18,7 @@
18
18
 
19
19
  module NicInfo
20
20
 
21
- VERSION = "1.5.0"
21
+ VERSION = "1.5.2"
22
22
  VERSION_LABEL = "NicInfo v." + VERSION
23
23
  COPYRIGHT = "Copyright (c) 2011-2017 American Registry for Internet Numbers (ARIN)"
24
24
  CONFIG_VERSION = 4
@@ -319,7 +319,8 @@ module NicInfo
319
319
  if data == nil
320
320
 
321
321
  @config.logger.trace("Issuing GET for " + url)
322
- uri = URI.parse( URI::encode( url ) )
322
+ p = URI::Parser.new
323
+ uri = URI.parse( p.escape( url ) )
323
324
  req = Net::HTTP::Get.new(uri.request_uri)
324
325
  req["User-Agent"] = NicInfo::VERSION_LABEL
325
326
  req["Accept"] = NicInfo::RDAP_CONTENT_TYPE + ", " + NicInfo::JSON_CONTENT_TYPE
@@ -376,7 +377,8 @@ module NicInfo
376
377
  def get_file_via_http url, file_name, try
377
378
 
378
379
  @config.logger.trace("Downloading " + url + " to " + file_name )
379
- uri = URI.parse( URI::encode( url ) )
380
+ p = URI::Parser.new
381
+ uri = URI.parse( p.escape( url ) )
380
382
  req = Net::HTTP::Get.new(uri.request_uri)
381
383
  req["User-Agent"] = NicInfo::VERSION_LABEL
382
384
  req["Accept"] = NicInfo::JSON_CONTENT_TYPE
@@ -937,7 +939,7 @@ HELP_SUMMARY
937
939
 
938
940
  # Creates a query type
939
941
  def create_resource_url(args, queryType)
940
-
942
+ p = URI::Parser.new
941
943
  path = ""
942
944
  case queryType
943
945
  when QueryType::BY_IP4_ADDR
@@ -959,15 +961,15 @@ HELP_SUMMARY
959
961
  path = tree.find_rest_ref(args[0])
960
962
  raise ArgumentError.new("Unable to find result for " + args[0]) unless path
961
963
  when QueryType::BY_ENTITY_HANDLE
962
- path << "entity/" << URI.escape( args[ 0 ] )
964
+ path << "entity/" << p.escape( args[ 0 ] )
963
965
  when QueryType::SRCH_ENTITY_BY_NAME
964
966
  case args.length
965
967
  when 1
966
- path << "entities?fn=" << URI.escape( args[ 0 ] )
968
+ path << "entities?fn=" << p.escape( args[ 0 ] )
967
969
  when 2
968
- path << "entities?fn=" << URI.escape( args[ 0 ] + " " + args[ 1 ] )
970
+ path << "entities?fn=" << p.escape( args[ 0 ] + " " + args[ 1 ] )
969
971
  when 3
970
- path << "entities?fn=" << URI.escape( args[ 0 ] + " " + args[ 1 ] + " " + args[ 2 ] )
972
+ path << "entities?fn=" << p.escape( args[ 0 ] + " " + args[ 1 ] + " " + args[ 2 ] )
971
973
  end
972
974
  when QueryType::SRCH_DOMAIN_BY_NAME
973
975
  path << "domains?name=" << args[ 0 ]
data/lib/nicinfo/utils.rb CHANGED
@@ -20,8 +20,9 @@ require 'nicinfo/config'
20
20
  module NicInfo
21
21
 
22
22
  def NicInfo.make_safe( url )
23
- safe = URI.escape( url )
24
- safe = URI.escape( safe, "!*'();:@&=+$,/?#[]" )
23
+ p = URI::Parser.new
24
+ safe = p.escape( url )
25
+ safe = p.escape( safe, "!*'();:@&=+$,/?#[]" )
25
26
  return safe
26
27
  end
27
28
 
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nicinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Newton
8
- autorequire:
8
+ - Garth Dubin
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2021-03-15 00:00:00.000000000 Z
12
+ date: 2023-04-28 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: netaddr
@@ -53,7 +54,7 @@ dependencies:
53
54
  - !ruby/object:Gem::Version
54
55
  version: 0.8.3
55
56
  description: A command-line RDAP client.
56
- email: andy@arin.net
57
+ email: gdubin@arin.net
57
58
  executables:
58
59
  - nicinfo
59
60
  extensions: []
@@ -114,7 +115,7 @@ homepage: https://github.com/arinlabs/nicinfo
114
115
  licenses:
115
116
  - ISC
116
117
  metadata: {}
117
- post_install_message:
118
+ post_install_message:
118
119
  rdoc_options: []
119
120
  require_paths:
120
121
  - lib
@@ -129,8 +130,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
130
  - !ruby/object:Gem::Version
130
131
  version: '0'
131
132
  requirements: []
132
- rubygems_version: 3.0.3
133
- signing_key:
133
+ rubygems_version: 3.2.3
134
+ signing_key:
134
135
  specification_version: 4
135
136
  summary: RDAP Client
136
137
  test_files: []