Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

.CZ, .TZ parsers now support registry property.

  • Loading branch information...
commit e292ce1529cfa8eec98acc2b2c28fad773732ee7 1 parent 2b3f0c7
@weppos authored
Showing with 86 additions and 0 deletions.
  1. +2 −0  CHANGELOG.md
  2. +10 −0 lib/whois/record/parser/base_whoisd.rb
  3. +3 −0  lib/whois/record/parser/whois.nic.fo.rb
  4. +3 −0  spec/fixtures/responses/whois.nic.cz/status_available.expected
  5. +9 −0 spec/fixtures/responses/whois.nic.cz/status_registered.expected
  6. +4 −0 spec/fixtures/responses/whois.nic.fo/status_available.expected
  7. +4 −0 spec/fixtures/responses/whois.nic.fo/status_registered.expected
  8. +1 −0  spec/fixtures/responses/whois.tld.ee/status_registered.expected
  9. +3 −0  spec/fixtures/responses/whois.tznic.or.tz/status_available.expected
  10. +8 −0 spec/fixtures/responses/whois.tznic.or.tz/status_registered.expected
  11. +5 −0 spec/whois/record/parser/responses/whois.nic.cz/status_available_spec.rb
  12. +9 −0 spec/whois/record/parser/responses/whois.nic.cz/status_registered_spec.rb
  13. +5 −0 spec/whois/record/parser/responses/whois.nic.fo/status_available_spec.rb
  14. +5 −0 spec/whois/record/parser/responses/whois.nic.fo/status_registered_spec.rb
  15. +1 −0  spec/whois/record/parser/responses/whois.tld.ee/status_registered_spec.rb
  16. +5 −0 spec/whois/record/parser/responses/whois.tznic.or.tz/status_available_spec.rb
  17. +9 −0 spec/whois/record/parser/responses/whois.tznic.or.tz/status_registered_spec.rb
View
2  CHANGELOG.md
@@ -12,6 +12,8 @@
* NEW: Added whois.nic.fo parser (GH-177).
+* NEW: .CZ, .TZ parsers now support registry property.
+
* CHANGE: Deprecated options[:web] for :web adapter in favor of options[:url].
* CHANGE: Removed Pir adaper, the registry is a thick whois server.
View
10 lib/whois/record/parser/base_whoisd.rb
@@ -66,6 +66,16 @@ class BaseWhoisd < Base
end
+ property_supported :registrar do
+ if content_for_scanner =~ /registrar:\s+(.+)\n/
+ Whois::Record::Registrar.new(
+ :id => $1,
+ :name => $1
+ )
+ end
+ end
+
+
property_supported :nameservers do
content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |name|
Record::Nameserver.new(:name => name.strip)
View
3  lib/whois/record/parser/whois.nic.fo.rb
@@ -25,6 +25,9 @@ class Parser
#
# @since RELEASE
class WhoisNicFo < BaseWhoisd
+
+ property_not_supported :registrar
+
end
end
View
3  spec/fixtures/responses/whois.nic.cz/status_available.expected
@@ -18,6 +18,9 @@
should: %s == nil
+#registrar
+ should: %s == nil
+
#nameservers
should: %s CLASS(array)
should: %s == []
View
9 spec/fixtures/responses/whois.nic.cz/status_registered.expected
@@ -20,6 +20,15 @@
should: %s CLASS(time)
should: %s == Time.parse("2013-07-22")
+
+#registrar
+ should: %s CLASS(registrar)
+ should: %s.id == "REG-MARKMONITOR"
+ should: %s.name == "REG-MARKMONITOR"
+ should: %s.organization == nil
+ should: %s.url == nil
+
+
#nameservers
should: %s CLASS(array)
should: %s SIZE(4)
View
4 spec/fixtures/responses/whois.nic.fo/status_available.expected
@@ -18,6 +18,10 @@
should: %s == nil
+#registrar
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+
#nameservers
should: %s CLASS(array)
should: %s == []
View
4 spec/fixtures/responses/whois.nic.fo/status_registered.expected
@@ -21,6 +21,10 @@
should: %s == Time.parse("2014-01-03")
+#registrar
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+
#nameservers
should: %s CLASS(array)
should: %s SIZE(5)
View
1  spec/fixtures/responses/whois.tld.ee/status_registered.expected
@@ -26,6 +26,7 @@
should: %s.id == "fraktal"
should: %s.name == "fraktal"
should: %s.organization == nil
+ should: %s.url == nil
#registrant_contacts
should: %s CLASS(array)
View
3  spec/fixtures/responses/whois.tznic.or.tz/status_available.expected
@@ -18,6 +18,9 @@
should: %s == nil
+#registrar
+ should: %s == nil
+
#nameservers
should: %s CLASS(array)
should: %s == []
View
8 spec/fixtures/responses/whois.tznic.or.tz/status_registered.expected
@@ -21,6 +21,14 @@
should: %s == Time.parse("2012-07-27")
+#registrar
+ should: %s CLASS(registrar)
+ should: %s.id == "REG-TZNIC"
+ should: %s.name == "REG-TZNIC"
+ should: %s.organization == nil
+ should: %s.url == nil
+
+
#nameservers
should: %s CLASS(array)
should: %s SIZE(2)
View
5 spec/whois/record/parser/responses/whois.nic.cz/status_available_spec.rb
@@ -51,6 +51,11 @@
@parser.expires_on.should == nil
end
end
+ describe "#registrar" do
+ it do
+ @parser.registrar.should == nil
+ end
+ end
describe "#nameservers" do
it do
@parser.nameservers.should be_a(Array)
View
9 spec/whois/record/parser/responses/whois.nic.cz/status_registered_spec.rb
@@ -54,6 +54,15 @@
@parser.expires_on.should == Time.parse("2013-07-22")
end
end
+ describe "#registrar" do
+ it do
+ @parser.registrar.should be_a(Whois::Record::Registrar)
+ @parser.registrar.id.should == "REG-MARKMONITOR"
+ @parser.registrar.name.should == "REG-MARKMONITOR"
+ @parser.registrar.organization.should == nil
+ @parser.registrar.url.should == nil
+ end
+ end
describe "#nameservers" do
it do
@parser.nameservers.should be_a(Array)
View
5 spec/whois/record/parser/responses/whois.nic.fo/status_available_spec.rb
@@ -51,6 +51,11 @@
@parser.expires_on.should == nil
end
end
+ describe "#registrar" do
+ it do
+ lambda { @parser.registrar }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
describe "#nameservers" do
it do
@parser.nameservers.should be_a(Array)
View
5 spec/whois/record/parser/responses/whois.nic.fo/status_registered_spec.rb
@@ -54,6 +54,11 @@
@parser.expires_on.should == Time.parse("2014-01-03")
end
end
+ describe "#registrar" do
+ it do
+ lambda { @parser.registrar }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
describe "#nameservers" do
it do
@parser.nameservers.should be_a(Array)
View
1  spec/whois/record/parser/responses/whois.tld.ee/status_registered_spec.rb
@@ -60,6 +60,7 @@
@parser.registrar.id.should == "fraktal"
@parser.registrar.name.should == "fraktal"
@parser.registrar.organization.should == nil
+ @parser.registrar.url.should == nil
end
end
describe "#registrant_contacts" do
View
5 spec/whois/record/parser/responses/whois.tznic.or.tz/status_available_spec.rb
@@ -51,6 +51,11 @@
@parser.expires_on.should == nil
end
end
+ describe "#registrar" do
+ it do
+ @parser.registrar.should == nil
+ end
+ end
describe "#nameservers" do
it do
@parser.nameservers.should be_a(Array)
View
9 spec/whois/record/parser/responses/whois.tznic.or.tz/status_registered_spec.rb
@@ -54,6 +54,15 @@
@parser.expires_on.should == Time.parse("2012-07-27")
end
end
+ describe "#registrar" do
+ it do
+ @parser.registrar.should be_a(Whois::Record::Registrar)
+ @parser.registrar.id.should == "REG-TZNIC"
+ @parser.registrar.name.should == "REG-TZNIC"
+ @parser.registrar.organization.should == nil
+ @parser.registrar.url.should == nil
+ end
+ end
describe "#nameservers" do
it do
@parser.nameservers.should be_a(Array)
Please sign in to comment.
Something went wrong with that request. Please try again.