cymruwhois 0.0.2 → 0.1.0

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.
@@ -2,3 +2,8 @@
2
2
 
3
3
  * 1 major enhancement:
4
4
  * Initial release
5
+
6
+ === 0.1.0 2012-03-04
7
+
8
+ * Added exception handling for CIDR blocks that don't have any records
9
+ * Workaround on mutiple AS Numbers for the same CIDR block
@@ -2,7 +2,7 @@ require "rubygems"
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "cymruwhois"
5
- s.version = "0.0.2"
5
+ s.version = "0.1.0"
6
6
  s.license = "MIT"
7
7
  s.author = "Jun C. Valdez"
8
8
  s.email = "rubygems@sploitlabs.com"
@@ -13,7 +13,11 @@ module Cymru
13
13
  module DNSquery
14
14
  def intxt(name)
15
15
  dns = Resolv::DNS.new
16
- ans = dns.getresource(name, Resolv::DNS::Resource::IN::TXT)
16
+ begin
17
+ ans = dns.getresource(name, Resolv::DNS::Resource::IN::TXT)
18
+ rescue Resolv::ResolvError
19
+ return arr = "0|0.0.0.0|CC|NIC|Date".split('|').map {|e| e.upcase.strip}
20
+ end
17
21
  arr = ans.data.split('|').map {|e| e.upcase.strip}
18
22
  end
19
23
  end
@@ -45,9 +49,12 @@ module Cymru
45
49
  @country = ansip[2]
46
50
  @registry = ansip[3]
47
51
  @allocdate = ansip[4]
48
-
52
+
53
+ # to address the multi ASN issue for the same IP Block
54
+ asparam = ansip[0].split
55
+
49
56
  ansasnum = Cymru::ASNumber.new
50
- ansasnum.whois(@asnum)
57
+ ansasnum.whois(asparam[0])
51
58
  @asname = ansasnum.asname
52
59
 
53
60
  ansip << @asname
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 2
10
- version: 0.0.2
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jun C. Valdez
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-30 00:00:00 Z
18
+ date: 2012-03-04 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: |-