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

Update rotld whois #95

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 10 additions & 4 deletions lib/whois/parsers/whois.rotld.ro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,19 @@ class WhoisRotldRo < Base
!available?
end


property_not_supported :created_on
property_supported :created_on do
if content_for_scanner =~ /Registered On:\s+(.+?)\n/
parse_time($1)
end
end

property_not_supported :updated_on

property_not_supported :expires_on

property_supported :expires_on do
if content_for_scanner =~ /Expires On:\s+(.+?)\n/
parse_time($1)
end
end

property_supported :nameservers do
content_for_scanner.scan(/Nameserver:\s+(.+)\n/).flatten.map do |name|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
% Top Level Domain : ro
% Maintainance : www.rotld.ro

Domain Name: google.ro
Registered On: 2000-07-17
Registrar: MarkMonitor Inc.
Referral URL:

Nameserver: ns4.google.com
Nameserver: ns1.google.com
Nameserver: ns3.google.com
Nameserver: ns2.google.com

Domain Status: UpdateProhibited


Domain Name: google.ro
Registered On: 2000-07-17
Expires On: 2018-09-17
Registrar: MarkMonitor Inc.
Referral URL: www.markmonitor.com

DNSSEC: Inactive

Nameserver: ns1.google.com
Nameserver: ns2.google.com
Nameserver: ns3.google.com
Nameserver: ns4.google.com

Domain Status: UpdateProhibited


Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@


#created_on
%s %ERROR{AttributeNotSupported}
%s %CLASS{time}
%s %TIME{2000-07-17 00:00:00.000000000 +0000}

#updated_on
%s %ERROR{AttributeNotSupported}

#expires_on
%s %ERROR{AttributeNotSupported}
%s %CLASS{time}
%s %TIME{2000-07-17 00:00:00.000000000 +0000}


#nameservers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@


#created_on
%s %ERROR{AttributeNotSupported}
%s %CLASS{time}
%s %TIME{2000-07-17 00:00:00.000000000 +0000}

#updated_on
%s %ERROR{AttributeNotSupported}

#expires_on
%s %ERROR{AttributeNotSupported}
%s %CLASS{time}
%s %TIME{2000-07-17 00:00:00.000000000 +0000}


#nameservers
Expand Down
29 changes: 16 additions & 13 deletions spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
% Top Level Domain : ro
% Maintainance : www.rotld.ro

Domain Name: google.ro
Registered On: 2000-07-17
Registrar: MarkMonitor Inc.
Referral URL: http://www.markmonitor.com

Nameserver: ns1.google.com
Nameserver: ns2.google.com
Nameserver: ns3.google.com
Nameserver: ns4.google.com

Domain Status: UpdateProhibited


Domain Name: google.ro
Registered On: 2000-07-17
Expires On: 2018-09-17
Registrar: MarkMonitor Inc.
Referral URL: www.markmonitor.com

DNSSEC: Inactive

Nameserver: ns1.google.com
Nameserver: ns2.google.com
Nameserver: ns3.google.com
Nameserver: ns4.google.com

Domain Status: UpdateProhibited


Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
end
describe "#created_on" do
it do
expect { subject.created_on }.to raise_error(Whois::AttributeNotSupported)
expect(subject.created_on).to eq(nil)
end
end
describe "#updated_on" do
Expand All @@ -48,7 +48,7 @@
end
describe "#expires_on" do
it do
expect { subject.expires_on }.to raise_error(Whois::AttributeNotSupported)
expect(subject.created_on).to eq(nil)
end
end
describe "#nameservers" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
end
describe "#created_on" do
it do
expect { subject.created_on }.to raise_error(Whois::AttributeNotSupported)
expect(subject.created_on).to eq(Time.parse("2000-07-17 00:00:00.000000000 +0000"))
end
end
describe "#updated_on" do
Expand All @@ -48,7 +48,7 @@
end
describe "#expires_on" do
it do
expect { subject.expires_on }.to raise_error(Whois::AttributeNotSupported)
expect(subject.created_on).to eq(Time.parse("2000-07-17 00:00:00.000000000 +0000"))
end
end
describe "#nameservers" do
Expand Down