Skip to content

Commit

Permalink
WhoisNicFr parser doesn't recognize nameservers when some nameserver …
Browse files Browse the repository at this point in the history
…has only ipv4 and no ipv6
  • Loading branch information
weppos committed Feb 20, 2011
1 parent 5c62f3d commit ccb0768
Show file tree
Hide file tree
Showing 23 changed files with 570 additions and 118 deletions.
4 changes: 2 additions & 2 deletions lib/whois/answer/parser/whois.nic.fr.rb
Expand Up @@ -80,8 +80,8 @@ class WhoisNicFr < Base

property_supported :nameservers do
content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |line|
if line =~ /(.+) \[(.+) (.+)\]/
Answer::Nameserver.new($1, $2, $3)
if line =~ /(.+) \[(.+)\]/
Answer::Nameserver.new($1, *$2.split(/\s+/))
else
Answer::Nameserver.new(line)
end
Expand Down
@@ -0,0 +1,85 @@
%%
%% This is the AFNIC Whois server.
%%
%% complete date format : DD/MM/YYYY
%% short date format : DD/MM
%% version : FRNIC-2.5
%%
%% Rights restricted by copyright.
%% See http://www.afnic.fr/afnic/web/mentions-legales-whois_en
%%
%% Use '-h' option to obtain more information about this service.
%%
%% [79.2.212.247 REQUEST] >> nic.fr
%%
%% RL Net [##########] - RL IP [#########.]
%%

domain: nic.fr
status: ACTIVE
hold: NO
holder-c: AFNI21-FRNIC
admin-c: NFC1-FRNIC
tech-c: NFC1-FRNIC
zone-c: NFC1-FRNIC
nsl-id: NSL40383-FRNIC
registrar: AFNIC registry
anniversary: 01/01
created: 01/01/1995
last-update: 02/08/2010
source: FRNIC

ns-list: NSL40383-FRNIC
nserver: ns1.nic.fr [192.134.4.1 2001:660:3003:2::4:1]
nserver: ns2.nic.fr [192.93.0.4 2001:660:3005:1::1:2]
nserver: ns3.nic.fr [192.134.0.49 2001:660:3006:1::1:1]
nserver: ns1.ext.nic.fr [193.51.208.13]
nserver: ns4.ext.nic.fr [193.0.9.4 2001:67c:e0::4]
nserver: ns5.ext.nic.fr [206.167.244.5]
source: FRNIC

registrar: AFNIC registry
type: Isp Option 2
anonymous: YES
registered: 22/05/1997
source: FRNIC

nic-hdl: NFC1-FRNIC
type: ROLE
contact: NIC France Contact
address: AFNIC
address: immeuble international
address: 2, rue Stephenson
address: Montigny le Bretonneux
address: 78181 Saint Quentin en Yvelines Cedex
country: FR
phone: +33 1 39 30 83 00
e-mail: hostmaster@nic.fr
admin-c: NFC1-FRNIC
tech-c: PL12-FRNIC
tech-c: JP-FRNIC
tech-c: MS1887-FRNIC
tech-c: VL-FRNIC
tech-c: PR1249-FRNIC
tech-c: PV827-FRNIC
tech-c: GO661-FRNIC
tech-c: MS-FRNIC
tech-c: AI1-FRNIC
changed: 23/08/2005 hostmaster@nic.fr
anonymous: NO
obsoleted: NO
source: FRNIC

nic-hdl: AFNI21-FRNIC
type: ORGANIZATION
contact: ASS FRANC NOMMAGE INTERNET EN COOP
address: immeuble international
address: 2, rue Stephenson
address: 78181 Montigny-le-Bretonneux
country: FR
changed: 02/12/2009 nic@nic.fr
anonymous: NO
obsoleted: NO
idstatus: ok
source: FRNIC

98 changes: 98 additions & 0 deletions spec/fixtures/responses/whois.nic.fr/fr/status_registered.txt
@@ -0,0 +1,98 @@
%%
%% This is the AFNIC Whois server.
%%
%% complete date format : DD/MM/YYYY
%% short date format : DD/MM
%% version : FRNIC-2.5
%%
%% Rights restricted by copyright.
%% See http://www.afnic.fr/afnic/web/mentions-legales-whois_en
%%
%% Use '-h' option to obtain more information about this service.
%%
%% [80.181.162.148 REQUEST] >> google.fr
%%
%% RL Net [##########] - RL IP [#########.]
%%

domain: google.fr
status: ACTIVE
hold: NO
holder-c: GI658-FRNIC
admin-c: TT599-FRNIC
tech-c: MC239-FRNIC
zone-c: NFC1-FRNIC
nsl-id: NSL4386-FRNIC
registrar: eMARKMONITOR Inc. dba MARKMONITOR
anniversary: 03/06
created: 27/07/2000
last-update: 03/06/2009
source: FRNIC

ns-list: NSL4386-FRNIC
nserver: ns1.google.com
nserver: ns2.google.com
nserver: ns3.google.com
nserver: ns4.google.com
source: FRNIC

registrar: eMARKMONITOR Inc. dba MARKMONITOR
type: Isp Option 1
address: Emerald Tech Center
address: 391 N. Ancestor Place
address: ID 83704 BOISE
country: US
phone: +1 208 389 5740
fax-no: +1 208 389 5771
e-mail: ccops@markmonitor.com
website: http://www.markmonitor.com
anonymous: NO
registered: 10/01/2002
source: FRNIC

nic-hdl: GI658-FRNIC
type: ORGANIZATION
contact: Google Inc.
address: 1600, Amphitheatre Parkway
address: 94043 Mountain View Ca
country: US
phone: +1 650 253 0000
fax-no: +1 650 618 8571
e-mail: dns-admin@google.com
changed: 09/07/2009 nic@nic.fr
anonymous: NO
obsoleted: NO
idstatus: dy
source: FRNIC

nic-hdl: TT599-FRNIC
type: PERSON
contact: Tu Tsao
address: Google France
address: 38, avenue de l'Opera
address: 75002 Paris
country: FR
phone: +33 6 50 33 00 10
e-mail: dns-admin@google.com
changed: 24/02/2009 ccops@markmonitor.com
anonymous: NO
obsoleted: NO
source: FRNIC

nic-hdl: MC239-FRNIC
type: ROLE
contact: MARKMONITOR CCOPS
address: eMarkmonitor Inc. dba MarkMonitor
address: PMB 155
address: 10400 Overland Road
address: 83709-1433 Boise, Id
address: US
phone: +01 2083895740
e-mail: ccops@markmonitor.com
admin-c: DL534-FRNIC
tech-c: DL534-FRNIC
changed: 10/10/2008 ccops@markmonitor.com
anonymous: NO
obsoleted: NO
source: FRNIC

88 changes: 88 additions & 0 deletions spec/fixtures/responses/whois.nic.fr/pm/status_registered.txt
@@ -0,0 +1,88 @@
%% * . * *
%% This is the AFNIC Whois server. * . . /.\ .
%% . /.^'\ *
%% complete date format : DD/MM/YYYY * * /'.'\
%% short date format : DD/MM . * /.^'.'\ .
%% version : FRNIC-2.5 . . /'.^'.\ .
%% * ^^|_|^^ *
%% Rights restricted by copyright.
%% See http://www.afnic.fr/afnic/web/mentions-legales-whois_en
%%
%% Use '-h' option to obtain more information about this service.
%%
%% [82.52.147.63 REQUEST] >> nic.pm
%%
%% RL Net [##########] - RL IP [#########.]
%%

domain: nic.pm
status: ACTIVE
hold: NO
holder-c: APEM2-FRNIC
admin-c: NFC1-FRNIC
tech-c: NFC1-FRNIC
zone-c: NFC1-FRNIC
nsl-id: NSL1-FRNIC
remarks: Website at: http://www.nic.pm/
remarks: Whois site at: whois.nic.fr
remarks: Please email mailto: nic@nic.fr
remarks: Spam mailto: abuse@nic.fr
remarks: Test mailto: ping@nic.fr
registrar: AFNIC registry
anniversary: 01/01
created: 01/01/1995
last-update: 17/09/2004
source: FRNIC

ns-list: NSL1-FRNIC
nserver: ns1.nic.fr [192.93.0.1 2001:660:3005:1::1:1]
nserver: ns2.nic.fr [192.93.0.4 2001:660:3005:1::1:2]
nserver: ns3.nic.fr [192.134.0.49 2001:660:3006:1::1:1]
source: FRNIC

registrar: AFNIC registry
type: Isp Option 2
anonymous: YES
registered: 22/05/1997
source: FRNIC

nic-hdl: NFC1-FRNIC
type: ROLE
contact: NIC France Contact
address: AFNIC
address: immeuble international
address: 2, rue Stephenson
address: Montigny le Bretonneux
address: 78181 Saint Quentin en Yvelines Cedex
country: FR
phone: +33 1 39 30 83 00
e-mail: hostmaster@nic.fr
admin-c: NFC1-FRNIC
tech-c: PL12-FRNIC
tech-c: JP-FRNIC
tech-c: MS1887-FRNIC
tech-c: VL-FRNIC
tech-c: PR1249-FRNIC
tech-c: PV827-FRNIC
tech-c: GO661-FRNIC
tech-c: MS-FRNIC
tech-c: AI1-FRNIC
changed: 23/08/2005 hostmaster@nic.fr
anonymous: NO
obsoleted: NO
source: FRNIC

nic-hdl: APEM2-FRNIC
type: ORGANIZATION
contact: Afnic (Saint-Pierre et Miquelon - CTOM)
address: immeuble international
address: 2, rue Stephenson
address: Montigny-Le-Bretonneux
address: 78181 Saint Quentin en Yvelines Cedex
country: FR
changed: 09/10/2008 whoismaster@nic.fr
anonymous: NO
obsoleted: NO
idstatus: cl
source: FRNIC

83 changes: 83 additions & 0 deletions spec/fixtures/responses/whois.nic.fr/re/status_registered.txt
@@ -0,0 +1,83 @@
%% * . * *
%% This is the AFNIC Whois server. * . . /.\ .
%% . /.^'\ *
%% complete date format : DD/MM/YYYY * * /'.'\
%% short date format : DD/MM . * /.^'.'\ .
%% version : FRNIC-2.5 . . /'.^'.\ .
%% * ^^|_|^^ *
%% Rights restricted by copyright.
%% See http://www.afnic.fr/afnic/web/mentions-legales-whois_en
%%
%% Use '-h' option to obtain more information about this service.
%%
%% [82.52.147.63 REQUEST] >> nic.re
%%
%% RL Net [##########] - RL IP [#########.]
%%

domain: nic.re
status: ACTIVE
hold: NO
holder-c: A1967-FRNIC
admin-c: NFC1-FRNIC
tech-c: NFC1-FRNIC
zone-c: NFC1-FRNIC
nsl-id: NSL1-FRNIC
registrar: AFNIC registry
anniversary: 01/01
created: 01/01/1995
last-update: 12/03/2009
source: FRNIC

ns-list: NSL1-FRNIC
nserver: ns1.nic.fr [192.93.0.1 2001:660:3005:1::1:1]
nserver: ns2.nic.fr [192.93.0.4 2001:660:3005:1::1:2]
nserver: ns3.nic.fr [192.134.0.49 2001:660:3006:1::1:1]
source: FRNIC

registrar: AFNIC registry
type: Isp Option 2
anonymous: YES
registered: 22/05/1997
source: FRNIC

nic-hdl: NFC1-FRNIC
type: ROLE
contact: NIC France Contact
address: AFNIC
address: immeuble international
address: 2, rue Stephenson
address: Montigny le Bretonneux
address: 78181 Saint Quentin en Yvelines Cedex
country: FR
phone: +33 1 39 30 83 00
e-mail: hostmaster@nic.fr
admin-c: NFC1-FRNIC
tech-c: PL12-FRNIC
tech-c: JP-FRNIC
tech-c: MS1887-FRNIC
tech-c: VL-FRNIC
tech-c: PR1249-FRNIC
tech-c: PV827-FRNIC
tech-c: GO661-FRNIC
tech-c: MS-FRNIC
tech-c: AI1-FRNIC
changed: 23/08/2005 hostmaster@nic.fr
anonymous: NO
obsoleted: NO
source: FRNIC

nic-hdl: A1967-FRNIC
type: ORGANIZATION
contact: AFNIC
address: immeuble international
address: 2, rue Stephenson
address: Montigny-Le-Bretonneux
address: 78181 Saint Quentin en Yvelines
country: FR
changed: 02/12/2009 nic@nic.fr
anonymous: NO
obsoleted: NO
idstatus: ok
source: FRNIC

10 changes: 10 additions & 0 deletions spec/support/example/parser_example_group.rb
Expand Up @@ -19,6 +19,16 @@ def part(*args)
end
end

RSpec::Matchers.define :cache_property do |property|
match do |instance|
cache = instance.instance_variable_get(:"@cached_properties")
cache.key?(property).should be_false
value = instance.send(property)
cache.key?(property).should be_true
instance.send(property).should == value
end
end

RSpec::configure do |c|
def c.escaped_path(*parts)
Regexp.compile(parts.join('[\\\/]'))
Expand Down

0 comments on commit ccb0768

Please sign in to comment.