Skip to content

Commit

Permalink
whois.rnids.rs parser should support statuses Locked, Expired, and In…
Browse files Browse the repository at this point in the history
… Transfer
  • Loading branch information
weppos committed Jul 6, 2012
1 parent ca22aeb commit 703280c
Show file tree
Hide file tree
Showing 11 changed files with 264 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

* FIXED: whois.neworksolutions.com parser crashes when the contact name is blank.

* FIXED: whois.rnids.rs parser should support statuses Locked, Expired, and In Transfer.

* CHANGE: Deprecated options[:web] for :web adapter in favor of options[:url].

* CHANGE: Removed Pir adaper, the registry is a thick whois server.
Expand Down
8 changes: 7 additions & 1 deletion lib/whois/record/parser/whois.rnids.rs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ class WhoisRnidsRs < Base
case node("Domain status", &:downcase)
when nil
:available
when "active"
when 'active'
:registered
when 'locked'
:registered
when 'in transfer'
:registered
when 'expired'
:expired
else
Whois.bug!(ParserError, "Unknown status `#{node("Domain status")}'.")
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#status
should: %s == :expired

#available?
should: %s == false

#registered?
should: %s == true
37 changes: 37 additions & 0 deletions spec/fixtures/responses/whois.rnids.rs/property_status_expired.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
%
%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: saj.rs.
Domain status: Expired
Registration date: 17.06.2010 14:40:59
Modification date: 18.06.2012 02:00:02
Expiration date: 17.06.2012 14:40:59
Registrar: BGSVETIONIK.S.A.


Owner: Ana Rakovic


DNS: ns9.sajthosting.com. - 85.10.206.52
DNS: ns10.sajthosting.com. - 85.10.206.57


Administrative contact: Ana Rakovic

Technical contact: Davor Veselinovic
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#status
should: %s == :registered

#available?
should: %s == false

#registered?
should: %s == true
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
%
%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: saj.rs.
Domain status: In Transfer
Registration date: 17.06.2010 14:40:59
Modification date: 06.07.2012 16:24:55
Expiration date: 17.06.2013 14:40:59
Registrar: NINET Company d.o.o.


Owner: Ana Rakovic


DNS: ns1.bgsvetionik.com. -
DNS: ns2.bgsvetionik.com. -


Administrative contact: Ana Rakovic

Technical contact: Strahinja Stanković
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#status
should: %s == :registered

#available?
should: %s == false

#registered?
should: %s == true
40 changes: 40 additions & 0 deletions spec/fixtures/responses/whois.rnids.rs/property_status_locked.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
%
%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: kondor.rs.
Domain status: Locked
Registration date: 30.09.2009 16:19:08
Modification date: 18.11.2011 16:03:46
Expiration date: 30.09.2012 16:19:08
Registrar: BGSVETIONIK.S.A.


Owner: Slavisa Janjusevic


DNS: dns1.orion.rs. - 77.105.36.77
DNS: dns2.orion.rs. - 77.105.37.77
DNS: dns3.orion.rs. - 67.18.147.77
DNS: dns4.orion.rs. - 114.111.129.149


Administrative contact: Slavisa Janjusevic, Kondor DOO
Address: Kralja Petra I / 12, Smederevo, Serbia

Technical contact: Davor Veselinovic
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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/property_status_expired.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, "property_status_expired.expected" do

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

describe "#status" do
it do
@parser.status.should == :expired
end
end
describe "#available?" do
it do
@parser.available?.should == false
end
end
describe "#registered?" do
it do
@parser.registered?.should == true
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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/property_status_in_transfer.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, "property_status_in_transfer.expected" do

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

describe "#status" do
it do
@parser.status.should == :registered
end
end
describe "#available?" do
it do
@parser.available?.should == false
end
end
describe "#registered?" do
it do
@parser.registered?.should == true
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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/property_status_locked.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, "property_status_locked.expected" do

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

describe "#status" do
it do
@parser.status.should == :registered
end
end
describe "#available?" do
it do
@parser.available?.should == false
end
end
describe "#registered?" do
it do
@parser.registered?.should == true
end
end
end

0 comments on commit 703280c

Please sign in to comment.