Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whois.rnids.rs parser crashes when domain is private. #163

Merged
merged 1 commit into from
May 11, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/whois/record/scanners/whois.rnids.rs.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class WhoisRnidsRs < Base
:scan_group_keyvalue, :scan_group_keyvalue,
:flag_group_end, :flag_group_end,
:skip_empty_line, :skip_empty_line,
:skip_privacy,
] ]




Expand Down Expand Up @@ -68,6 +69,10 @@ class WhoisRnidsRs < Base
@input.skip(/^%.*\n/) @input.skip(/^%.*\n/)
end end


tokenizer :skip_privacy do
@input.skip(/^Whois privacy has been activated for domain.\n/)
end

end end


end end
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,11 @@
#registrant_contacts
should: %s CLASS(array)
should: %s == []

#admin_contacts
should: %s CLASS(array)
should: %s == []

#technical_contacts
should: %s CLASS(array)
should: %s == []
36 changes: 36 additions & 0 deletions spec/fixtures/responses/whois.rnids.rs/token_whois_privacy.txt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,36 @@
%
%This is the RNIDS Whois server.
%
% Date Format : DD.MM.YYYY
% Whois Server Version: 1.0.0
%
% Rights restricted by copyright.
% See http://www.rnids.rs/whois_en
%
%
%
% Ovo je odgovor od RNIDS Whois servera.
%
% Format datuma : DD.MM.YYYY
% Verzija Whois Servera : 1.0.0
%
% Sva prava zadržana. Za više informacija.
% pogledajte http://www.rnids.rs/whois_sr

Domain name: eg.rs.
Domain status: Active
Registration date: 22.10.2010 10:20:31
Modification date: 08.08.2011 11:13:00
Expiration date: 22.10.2012 10:20:31
Registrar: GAMA Electronics d.o.o.


Whois privacy has been activated for domain.


DNS: bits-hq.bitsyu.net. - 217.24.17.10
DNS: largo.bitsyu.net. - 217.24.17.80




Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,42 @@
# encoding: utf-8

# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.rnids.rs/token_whois_privacy.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#

require 'spec_helper'
require 'whois/record/parser/whois.rnids.rs.rb'

describe Whois::Record::Parser::WhoisRnidsRs, "token_whois_privacy.expected" do

before(:each) do
file = fixture("responses", "whois.rnids.rs/token_whois_privacy.txt")
part = Whois::Record::Part.new(:body => File.read(file))
@parser = klass.new(part)
end

describe "#registrant_contacts" do
it do
@parser.registrant_contacts.should be_a(Array)
@parser.registrant_contacts.should == []
end
end
describe "#admin_contacts" do
it do
@parser.admin_contacts.should be_a(Array)
@parser.admin_contacts.should == []
end
end
describe "#technical_contacts" do
it do
@parser.technical_contacts.should be_a(Array)
@parser.technical_contacts.should == []
end
end
end