Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

whois.nic.cz - Fixed parsing IPv6 glue address #135

Merged
merged 1 commit into from

2 participants

@kubicek

No description provided.

@weppos weppos merged commit e0b91e3 into from
@weppos
Owner

Merged, thank you!

@weppos weppos was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 4, 2011
  1. @kubicek
This page is out of date. Refresh to see the latest.
View
2  lib/whois/record/parser/whois.nic.cz.rb
@@ -74,7 +74,7 @@ class WhoisNicCz < Base
property_supported :nameservers do
content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |line|
if line =~ /(.+) \((.+)\)/
- Record::Nameserver.new($1, $2)
+ Record::Nameserver.new($1, *$2.split(", "))
else
Record::Nameserver.new(line.strip)
end
View
14 spec/fixtures/responses/whois.nic.cz/property_nameservers_with_ip.expected
@@ -1,9 +1,13 @@
#nameservers
should: %s be_a(Array)
- should: %s have(2).items
+ should: %s have(3).items
should: %s[0] be_a(_nameserver)
- should: %s[0].name == "ns.albatani.cz"
- should: %s[0].ipv4 == "195.122.208.21"
+ should: %s[0].name == "ns.kraxnet.com"
+ should: %s[0].ipv4 == nil
should: %s[1] be_a(_nameserver)
- should: %s[1].name == "ns.albatani.net"
- should: %s[1].ipv4 == nil
+ should: %s[1].name == "ns1.kraxnet.cz"
+ should: %s[1].ipv4 == "178.217.247.1"
+ should: %s[2] be_a(_nameserver)
+ should: %s[2].name == "ns.kraxnet.cz"
+ should: %s[2].ipv4 == "178.217.247.2"
+ should: %s[2].ipv6 == "2a02:1360::56"
View
16 spec/fixtures/responses/whois.nic.cz/property_nameservers_with_ip.txt
@@ -21,7 +21,7 @@
domain: albatani.cz
registrant: SB:EDRIVEHOSTING
admin-c: BRUHADAVID
-nsset: NSS:EDRIVEHOSTING:1
+nsset: NSS:KRAXNET:1
registrar: REG-GENREG
status: paid and in zone
registered: 07.08.1999 02:00:00
@@ -50,12 +50,14 @@ e-mail: domeny@edrive-hosting.cz
registrar: REG-GENREG
created: 22.08.2007 17:45:00
-nsset: NSS:EDRIVEHOSTING:1
-nserver: ns.albatani.cz (195.122.208.21)
-nserver: ns.albatani.net
-tech-c: BRUHADAVID
-tech-c: SB:EDRIVEHOSTING
-registrar: REG-GENREG
+nsset: NSS:KRAXNET:1
+nserver: ns.kraxnet.com
+nserver: ns1.kraxnet.cz (178.217.247.1)
+nserver: ns.kraxnet.cz (178.217.247.2, 2a02:1360::56)
+tech-c: SB:KRAXNET
+tech-c: KUBICEK
+registrar: REG-KRAXNET
created: 01.10.2007 02:00:00
+changed: 19.09.2011 17:48:26
View
14 spec/whois/record/parser/responses/whois.nic.cz/property_nameservers_with_ip_spec.rb
@@ -24,13 +24,17 @@
describe "#nameservers" do
it do
@parser.nameservers.should be_a(Array)
- @parser.nameservers.should have(2).items
+ @parser.nameservers.should have(3).items
@parser.nameservers[0].should be_a(_nameserver)
- @parser.nameservers[0].name.should == "ns.albatani.cz"
- @parser.nameservers[0].ipv4.should == "195.122.208.21"
+ @parser.nameservers[0].name.should == "ns.kraxnet.com"
+ @parser.nameservers[0].ipv4.should == nil
@parser.nameservers[1].should be_a(_nameserver)
- @parser.nameservers[1].name.should == "ns.albatani.net"
- @parser.nameservers[1].ipv4.should == nil
+ @parser.nameservers[1].name.should == "ns1.kraxnet.cz"
+ @parser.nameservers[1].ipv4.should == "178.217.247.1"
+ @parser.nameservers[2].should be_a(_nameserver)
+ @parser.nameservers[2].name.should == "ns.kraxnet.cz"
+ @parser.nameservers[2].ipv4.should == "178.217.247.2"
+ @parser.nameservers[2].ipv6.should == "2a02:1360::56"
end
end
end
Something went wrong with that request. Please try again.