whois 2.0.7 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +84 -10
- data/Rakefile +0 -7
- data/lib/core_ext.rb +9 -45
- data/lib/core_ext/array/extract_options.rb +29 -0
- data/lib/core_ext/array/wrap.rb +48 -0
- data/lib/core_ext/class/attribute.rb +115 -0
- data/lib/core_ext/date_time/conversions.rb +15 -0
- data/lib/core_ext/kernel/singleton_class.rb +13 -0
- data/lib/core_ext/module/remove_method.rb +16 -0
- data/lib/whois.rb +0 -4
- data/lib/whois/definitions/tlds.rb +10 -5
- data/lib/whois/record.rb +0 -3
- data/lib/whois/record/parser.rb +3 -3
- data/lib/whois/record/parser/NOTES.txt +15 -8
- data/lib/whois/record/parser/base.rb +12 -35
- data/lib/whois/record/parser/base_afilias.rb +156 -0
- data/lib/whois/record/parser/example.rb +8 -4
- data/lib/whois/record/parser/jobswhois.verisign-grs.com.rb +2 -2
- data/lib/whois/record/parser/scanners/afilias.rb +13 -4
- data/lib/whois/record/parser/{features → scanners}/ast.rb +1 -1
- data/lib/whois/record/parser/scanners/base.rb +9 -0
- data/lib/whois/record/parser/scanners/cnnic.rb +2 -2
- data/lib/whois/record/parser/scanners/{whoisbiz.rb → whois.biz.rb} +2 -8
- data/lib/whois/record/parser/scanners/whois.denic.de.rb +117 -0
- data/lib/whois/record/parser/scanners/whois.nic.hu.rb +187 -0
- data/lib/whois/record/parser/scanners/{whoisit.rb → whois.nic.it.rb} +2 -2
- data/lib/whois/record/parser/scanners/whois.registry.qa.rb +54 -0
- data/lib/whois/record/parser/scanners/whois.tld.ee.rb +41 -0
- data/lib/whois/record/parser/whois.aero.rb +8 -46
- data/lib/whois/record/parser/whois.afilias-grs.info.rb +2 -51
- data/lib/whois/record/parser/whois.afilias.info.rb +2 -126
- data/lib/whois/record/parser/whois.biz.rb +6 -6
- data/lib/whois/record/parser/whois.cnnic.cn.rb +5 -5
- data/lib/whois/record/parser/whois.crsnic.net.rb +2 -2
- data/lib/whois/record/parser/whois.denic.de.rb +8 -105
- data/lib/whois/record/parser/whois.dotmobiregistry.net.rb +2 -51
- data/lib/whois/record/parser/whois.godaddy.com.rb +138 -0
- data/lib/whois/record/parser/whois.iana.org.rb +2 -2
- data/lib/whois/record/parser/whois.markmonitor.com.rb +13 -12
- data/lib/whois/record/parser/whois.meregistry.net.rb +45 -30
- data/lib/whois/record/parser/whois.nic.af.rb +6 -2
- data/lib/whois/record/parser/whois.nic.ag.rb +2 -51
- data/lib/whois/record/parser/whois.nic.asia.rb +47 -38
- data/lib/whois/record/parser/whois.nic.cc.rb +2 -2
- data/lib/whois/record/parser/whois.nic.hu.rb +7 -174
- data/lib/whois/record/parser/whois.nic.it.rb +6 -6
- data/lib/whois/record/parser/whois.nic.name.rb +1 -5
- data/lib/whois/record/parser/whois.nic.travel.rb +4 -12
- data/lib/whois/record/parser/whois.nic.tv.rb +2 -2
- data/lib/whois/record/parser/whois.nic.us.rb +4 -4
- data/lib/whois/record/parser/whois.nic.xxx.rb +5 -112
- data/lib/whois/record/parser/whois.publicinterestregistry.net.rb +8 -168
- data/lib/whois/record/parser/whois.registry.in.rb +2 -60
- data/lib/whois/record/parser/whois.registry.qa.rb +117 -0
- data/lib/whois/record/parser/whois.ripn.net.rb +4 -84
- data/lib/whois/record/parser/whois.sgnic.sg.rb +13 -5
- data/lib/whois/record/parser/whois.tcinet.ru.rb +102 -0
- data/lib/whois/record/parser/whois.tld.ee.rb +5 -26
- data/lib/whois/record/parser/whois.tonic.to.rb +0 -8
- data/lib/whois/server/adapters/base.rb +23 -10
- data/lib/whois/version.rb +2 -2
- data/spec/fixtures/responses/FIND.txt +1 -0
- data/spec/fixtures/responses/whois.aero/status_available.expected +35 -1
- data/spec/fixtures/responses/whois.aero/status_registered.expected +77 -1
- data/spec/fixtures/responses/whois.afilias-grs.info/bz/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/bz/status_registered.expected +39 -2
- data/spec/fixtures/responses/whois.afilias-grs.info/bz/status_registered.txt +2 -82
- data/spec/fixtures/responses/whois.afilias-grs.info/gi/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/gi/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/hn/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/hn/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/lc/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/lc/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/mn/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/mn/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/sc/status_available.expected +57 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/sc/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/vc/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/vc/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.dotmobiregistry.net/status_available.expected +35 -0
- data/spec/fixtures/responses/whois.dotmobiregistry.net/status_available.txt +1 -25
- data/spec/fixtures/responses/whois.dotmobiregistry.net/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.educause.edu/{properties_updated_on_unknown.expected → property_updated_on_unknown.expected} +0 -0
- data/spec/fixtures/responses/whois.educause.edu/{properties_updated_on_unknown.txt → property_updated_on_unknown.txt} +0 -0
- data/spec/fixtures/responses/whois.godaddy.com/status_registered.expected +87 -0
- data/spec/fixtures/responses/whois.godaddy.com/status_registered.txt +60 -0
- data/spec/fixtures/responses/whois.markmonitor.com/{properties_empty_contacts.expected → property_contacts_are_blank.expected} +0 -0
- data/spec/fixtures/responses/whois.markmonitor.com/{properties_empty_contacts.txt → property_contacts_are_blank.txt} +0 -0
- data/spec/fixtures/responses/whois.meregistry.net/{property_nameservers_is_missing.expected → property_nameservers_is_blank.expected} +0 -0
- data/spec/fixtures/responses/whois.meregistry.net/{property_nameservers_is_missing.txt → property_nameservers_is_blank.txt} +0 -0
- data/spec/fixtures/responses/whois.meregistry.net/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.meregistry.net/status_registered.expected +77 -0
- data/spec/fixtures/responses/whois.meregistry.net/status_registered.txt +1 -1
- data/spec/fixtures/responses/{whois.nic.asia/property_status_client_delete_prohibited.expected → whois.nic.af/property_status_active.expected} +0 -0
- data/spec/fixtures/responses/whois.nic.af/property_status_active.txt +56 -0
- data/spec/fixtures/responses/{whois.nic.asia/property_status_client_transfer_prohibited.expected → whois.nic.af/property_status_delegated.expected} +0 -0
- data/spec/fixtures/responses/whois.nic.af/property_status_delegated.txt +46 -0
- data/spec/fixtures/responses/whois.nic.af/property_status_not_registered.expected +8 -0
- data/spec/fixtures/responses/whois.nic.af/property_status_not_registered.txt +13 -0
- data/spec/fixtures/responses/whois.nic.ag/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.nic.ag/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.nic.asia/property_status_multiple.expected +8 -0
- data/spec/fixtures/responses/whois.nic.asia/{property_status_client_delete_prohibited.txt → property_status_multiple.txt} +0 -0
- data/spec/fixtures/responses/whois.nic.asia/property_status_single.expected +8 -0
- data/spec/fixtures/responses/whois.nic.asia/{property_status_client_transfer_prohibited.txt → property_status_single.txt} +76 -76
- data/spec/fixtures/responses/whois.nic.asia/status_available.expected +35 -1
- data/spec/fixtures/responses/whois.nic.asia/status_registered.expected +78 -1
- data/spec/fixtures/responses/whois.nic.dz/{status_available.expected → dz/status_available.expected} +0 -0
- data/spec/fixtures/responses/whois.nic.dz/{status_available.txt → dz/status_available.txt} +0 -0
- data/spec/fixtures/responses/whois.nic.dz/{status_registered.expected → dz/status_registered.expected} +0 -0
- data/spec/fixtures/responses/whois.nic.dz/{status_registered.txt → dz/status_registered.txt} +0 -0
- data/spec/fixtures/responses/whois.nic.name/status_available.expected +1 -1
- data/spec/fixtures/responses/whois.nic.name/status_registered.expected +1 -1
- data/spec/fixtures/responses/whois.nic.travel/property_status_multiple.expected +2 -0
- data/spec/fixtures/responses/whois.nic.travel/property_status_multiple.txt +83 -0
- data/spec/fixtures/responses/whois.nic.travel/property_status_single.expected +2 -0
- data/spec/fixtures/responses/whois.nic.travel/property_status_single.txt +75 -0
- data/spec/fixtures/responses/whois.nic.travel/status_available.expected +1 -1
- data/spec/fixtures/responses/whois.nic.travel/status_registered.expected +1 -1
- data/spec/fixtures/responses/whois.nic.xxx/property_updated_on_blank.expected +2 -0
- data/spec/fixtures/responses/whois.nic.xxx/property_updated_on_blank.txt +98 -0
- data/spec/fixtures/responses/whois.nic.xxx/status_registered.expected +45 -46
- data/spec/fixtures/responses/whois.nic.xxx/status_registered.txt +61 -61
- data/spec/fixtures/responses/whois.publicinterestregistry.net/status_available.expected +1 -1
- data/spec/fixtures/responses/whois.publicinterestregistry.net/status_registered.expected +8 -1
- data/spec/fixtures/responses/whois.registry.in/property_status_missing.expected +1 -1
- data/spec/fixtures/responses/whois.registry.in/property_status_multiple.expected +1 -1
- data/spec/fixtures/responses/whois.registry.in/property_status_ok.expected +1 -1
- data/spec/fixtures/responses/whois.registry.in/status_available.expected +31 -1
- data/spec/fixtures/responses/whois.registry.in/status_registered.expected +70 -1
- data/spec/fixtures/responses/whois.registry.qa/qa/status_available.expected +56 -0
- data/spec/fixtures/responses/whois.registry.qa/qa/status_available.txt +1 -0
- data/spec/fixtures/responses/whois.registry.qa/qa/status_registered.expected +91 -0
- data/spec/fixtures/responses/whois.registry.qa/qa/status_registered.txt +23 -0
- data/spec/fixtures/responses/whois.sgnic.sg/property_nameservers_schema_1_with_ip.expected +12 -0
- data/spec/fixtures/responses/whois.sgnic.sg/property_nameservers_schema_1_with_ip.txt +94 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/property_nameservers_with_ip.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/property_nameservers_with_ip.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_available.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_available.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_registered.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_registered.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_available.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_available.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_registered.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_registered.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_available.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_available.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_registered.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_registered.txt +0 -0
- data/spec/integration_spec.rb +29 -12
- data/spec/support/helpers/spec_helper.rb +0 -10
- data/spec/tlds +1 -1
- data/spec/whois/record/parser/base_spec.rb +23 -51
- data/spec/whois/record/parser/responses/whois.aero/status_available_spec.rb +49 -1
- data/spec/whois/record/parser/responses/whois.aero/status_registered_spec.rb +91 -1
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/bz/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/bz/status_registered_spec.rb +53 -2
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/gi/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/gi/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/hn/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/hn/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/lc/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/lc/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/mn/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/mn/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/sc/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/sc/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/vc/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/vc/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.dotmobiregistry.net/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.dotmobiregistry.net/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/{properties_updated_on_unknown_spec.rb → property_updated_on_unknown_spec.rb} +3 -3
- data/spec/whois/record/parser/responses/whois.godaddy.com/status_registered_spec.rb +131 -0
- data/spec/whois/record/parser/responses/whois.markmonitor.com/{properties_empty_contacts_spec.rb → property_contacts_are_blank_spec.rb} +3 -3
- data/spec/whois/record/parser/responses/whois.meregistry.net/{property_nameservers_is_missing_spec.rb → property_nameservers_is_blank_spec.rb} +3 -3
- data/spec/whois/record/parser/responses/whois.meregistry.net/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.meregistry.net/status_registered_spec.rb +91 -0
- data/spec/whois/record/parser/responses/whois.nic.af/property_status_active_spec.rb +39 -0
- data/spec/whois/record/parser/responses/whois.nic.af/property_status_delegated_spec.rb +39 -0
- data/spec/whois/record/parser/responses/whois.nic.af/property_status_not_registered_spec.rb +39 -0
- data/spec/whois/record/parser/responses/whois.nic.ag/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.nic.ag/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.nic.asia/{property_status_client_delete_prohibited_spec.rb → property_status_multiple_spec.rb} +4 -4
- data/spec/whois/record/parser/responses/whois.nic.asia/{property_status_client_transfer_prohibited_spec.rb → property_status_single_spec.rb} +4 -4
- data/spec/whois/record/parser/responses/whois.nic.asia/status_available_spec.rb +49 -1
- data/spec/whois/record/parser/responses/whois.nic.asia/status_registered_spec.rb +92 -1
- data/spec/whois/record/parser/responses/whois.nic.dz/{status_available_spec.rb → dz/status_available_spec.rb} +2 -2
- data/spec/whois/record/parser/responses/whois.nic.dz/{status_registered_spec.rb → dz/status_registered_spec.rb} +2 -2
- data/spec/whois/record/parser/responses/whois.nic.name/status_available_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.nic.name/status_registered_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.nic.travel/property_status_multiple_spec.rb +29 -0
- data/spec/whois/record/parser/responses/whois.nic.travel/property_status_single_spec.rb +29 -0
- data/spec/whois/record/parser/responses/whois.nic.travel/status_available_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.nic.travel/status_registered_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.nic.xxx/property_updated_on_blank_spec.rb +29 -0
- data/spec/whois/record/parser/responses/whois.nic.xxx/status_registered_spec.rb +45 -46
- data/spec/whois/record/parser/responses/whois.publicinterestregistry.net/status_available_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.publicinterestregistry.net/status_registered_spec.rb +11 -1
- data/spec/whois/record/parser/responses/whois.registry.in/property_status_missing_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.registry.in/property_status_multiple_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.registry.in/property_status_ok_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.registry.in/status_available_spec.rb +44 -1
- data/spec/whois/record/parser/responses/whois.registry.in/status_registered_spec.rb +83 -1
- data/spec/whois/record/parser/responses/whois.registry.qa/qa/status_available_spec.rb +107 -0
- data/spec/whois/record/parser/responses/whois.registry.qa/qa/status_registered_spec.rb +142 -0
- data/spec/whois/record/parser/responses/whois.sgnic.sg/property_nameservers_schema_1_with_ip_spec.rb +39 -0
- data/spec/whois/record/parser/responses/{whois.ripn.net → whois.tcinet.ru}/ru/property_nameservers_with_ip_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net/su → whois.tcinet.ru/ru}/status_available_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_registered_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net/ru → whois.tcinet.ru/su}/status_available_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_registered_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_available_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_registered_spec.rb +4 -4
- data/spec/whois/record_spec.rb +4 -4
- data/spec/whois/server/adapters/afilias_spec.rb +3 -3
- data/spec/whois/server/adapters/base_spec.rb +50 -10
- data/spec/whois/server/adapters/formatted_spec.rb +4 -4
- data/spec/whois/server/adapters/pir_spec.rb +3 -3
- data/spec/whois/server/adapters/standard_spec.rb +4 -4
- data/spec/whois/server/adapters/verisign_spec.rb +7 -7
- data/whois.gemspec +4 -4
- metadata +101 -57
- data/lib/whois/answer.rb +0 -14
File without changes
|
data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/property_nameservers_with_ip.txt
RENAMED
File without changes
|
data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_available.expected
RENAMED
File without changes
|
File without changes
|
data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_registered.expected
RENAMED
File without changes
|
File without changes
|
data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_available.expected
RENAMED
File without changes
|
File without changes
|
data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_registered.expected
RENAMED
File without changes
|
File without changes
|
data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_available.expected
RENAMED
File without changes
|
data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_available.txt
RENAMED
File without changes
|
data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_registered.expected
RENAMED
File without changes
|
data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_registered.txt
RENAMED
File without changes
|
data/spec/integration_spec.rb
CHANGED
@@ -2,14 +2,16 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Whois do
|
4
4
|
|
5
|
+
let(:response) { "Domain: example.it\nStatus: AVAILABLE\n" }
|
6
|
+
|
5
7
|
describe "Basic WHOIS querying and parsing" do
|
6
8
|
it "works" do
|
7
9
|
with_definitions do
|
8
10
|
Whois::Server.define(:tld, ".it", "whois.nic.it")
|
9
|
-
Whois::Server::Adapters::Standard.any_instance
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
Whois::Server::Adapters::Standard.any_instance \
|
12
|
+
.expects(:ask_the_socket) \
|
13
|
+
.with("example.it", "whois.nic.it", 43) \
|
14
|
+
.returns(response)
|
13
15
|
|
14
16
|
record = Whois.query("example.it")
|
15
17
|
|
@@ -23,17 +25,32 @@ describe Whois do
|
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
26
|
-
describe "
|
27
|
-
it "
|
28
|
+
describe "Passing :bind_host and :bind_port options" do
|
29
|
+
it "binds the WHOIS query to given host and port" do
|
30
|
+
with_definitions do
|
31
|
+
Whois::Server.define(:tld, ".it", "whois.nic.it")
|
32
|
+
Whois::Server::Adapters::Standard.any_instance \
|
33
|
+
.expects(:ask_the_socket) \
|
34
|
+
.with("example.it", "whois.nic.it", 43, "192.168.1.1", 3000) \
|
35
|
+
.returns(response)
|
36
|
+
|
37
|
+
client = Whois::Client.new(:bind_host => "192.168.1.1", :bind_port => 3000)
|
38
|
+
client.query("example.it")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "Passing :bind_port options" do
|
44
|
+
it "binds the WHOIS query to given port and defaults host" do
|
28
45
|
with_definitions do
|
29
46
|
Whois::Server.define(:tld, ".it", "whois.nic.it")
|
30
|
-
Whois::Server::Adapters::Standard.any_instance
|
31
|
-
|
32
|
-
|
33
|
-
|
47
|
+
Whois::Server::Adapters::Standard.any_instance \
|
48
|
+
.expects(:ask_the_socket) \
|
49
|
+
.with("example.it", "whois.nic.it", 43, Whois::Server::Adapters::Base::DEFAULT_BIND_HOST, 3000) \
|
50
|
+
.returns(response)
|
34
51
|
|
35
|
-
client = Whois::Client.new(:
|
36
|
-
|
52
|
+
client = Whois::Client.new(:bind_port => 3000)
|
53
|
+
client.query("example.it")
|
37
54
|
end
|
38
55
|
end
|
39
56
|
end
|
@@ -36,16 +36,6 @@ module SpecHelper
|
|
36
36
|
end
|
37
37
|
|
38
38
|
|
39
|
-
# Temporary resets parser @@registry
|
40
|
-
# to let the test setup a custom registry.
|
41
|
-
def with_registry
|
42
|
-
@_property_registry = Whois::Record::Parser::Base.send :class_variable_get, :@@property_registry
|
43
|
-
Whois::Record::Parser::Base.send :class_variable_set, :@@property_registry, {}
|
44
|
-
yield
|
45
|
-
ensure
|
46
|
-
Whois::Record::Parser::Base.send :class_variable_set, :@@property_registry, @_property_registry
|
47
|
-
end
|
48
|
-
|
49
39
|
def nameserver(*params)
|
50
40
|
Whois::Record::Nameserver.new(*params)
|
51
41
|
end
|
data/spec/tlds
CHANGED
@@ -237,7 +237,7 @@ ps;whois.pnina.ps;google.ps;u34jedzcq.ps
|
|
237
237
|
pt;whois.dns.pt;google.pt;u34jedzcq.pt
|
238
238
|
pw;;;
|
239
239
|
py;;;
|
240
|
-
qa
|
240
|
+
qa.com;whois.registry.qa;qtel.com.qa;u34jedzcq.qa
|
241
241
|
qc.com;whois.centralnic.com;ceo.qc.com;u34jedzcq.qc.com
|
242
242
|
re;whois.nic.fr;nic.re;u34jedzcq.re
|
243
243
|
ro;whois.rotld.ro;google.ro;u34jedzcq.ro
|
@@ -7,57 +7,29 @@ describe Whois::Record::Parser::Base do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
|
10
|
-
describe ".property_registry" do
|
11
|
-
it "returns the @@registry variable when class argument is not passed" do
|
12
|
-
with_registry do
|
13
|
-
klass.property_registry.should == klass.send(:class_variable_get, :@@property_registry)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
it "returns the hash for given class when class argument is passed" do
|
18
|
-
with_registry do
|
19
|
-
pklass = Class.new(klass)
|
20
|
-
klass.send(:class_variable_set, :@@property_registry, { pklass => {} })
|
21
|
-
|
22
|
-
klass.property_registry[pklass].should == Hash.new
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
it "lazy initializes the hash for given class" do
|
27
|
-
with_registry do
|
28
|
-
pklass = Class.new(klass)
|
29
|
-
klass.send(:class_variable_set, :@@property_registry, Hash.new)
|
30
|
-
klass.property_registry[pklass]
|
31
|
-
klass.send(:class_variable_get, :@@property_registry).should == {}
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
10
|
describe ".property_register" do
|
37
11
|
it "register given property" do
|
38
|
-
|
39
|
-
|
40
|
-
pklass.property_register(:greetings, :supported)
|
12
|
+
koncrete = Class.new(klass)
|
13
|
+
koncrete.property_register(:greetings, :supported)
|
41
14
|
|
42
|
-
|
43
|
-
end
|
15
|
+
koncrete._properties[:greetings].should == :supported
|
44
16
|
end
|
45
17
|
end
|
46
18
|
|
47
19
|
describe "#property_supported?" do
|
48
20
|
it "returns false if the property is not supported" do
|
49
|
-
|
21
|
+
koncrete = Class.new(klass) do
|
50
22
|
end
|
51
|
-
|
52
|
-
|
23
|
+
koncrete.new(@part).property_supported?(:disclaimer).should be_false
|
24
|
+
koncrete.new(@part).respond_to?(:disclaimer).should be_true
|
53
25
|
end
|
54
26
|
|
55
27
|
it "returns true if the property is supported" do
|
56
|
-
|
28
|
+
koncrete = Class.new(klass) do
|
57
29
|
property_register(:disclaimer, :supported) {}
|
58
30
|
end
|
59
|
-
|
60
|
-
|
31
|
+
koncrete.new(@part).property_supported?(:disclaimer).should be_true
|
32
|
+
koncrete.new(@part).respond_to?(:disclaimer).should be_true
|
61
33
|
end
|
62
34
|
end
|
63
35
|
|
@@ -96,30 +68,30 @@ describe Whois::Record::Parser::Base do
|
|
96
68
|
|
97
69
|
describe "#is" do
|
98
70
|
it "calls the method if the object respond to the method" do
|
99
|
-
|
100
|
-
|
71
|
+
koncrete = Class.new(klass) { def response_throttled?; true; end }.new(Whois::Record::Part.new)
|
72
|
+
koncrete.is(:response_throttled?)
|
101
73
|
end
|
102
74
|
it "does not call the method if the object does not respond to the method" do
|
103
|
-
|
104
|
-
|
75
|
+
koncrete = Class.new(klass).new(Whois::Record::Part.new)
|
76
|
+
koncrete.is(:response_throttled?).should be_false
|
105
77
|
end
|
106
78
|
end
|
107
79
|
|
108
80
|
describe "#validate!" do
|
109
81
|
it "raises Whois::ResponseIsThrottled when the response is throttled" do
|
110
|
-
|
111
|
-
lambda {
|
82
|
+
koncrete = Class.new(klass) { def response_throttled?; true; end }.new(Whois::Record::Part.new)
|
83
|
+
lambda { koncrete.validate! }.should raise_error(Whois::ResponseIsThrottled)
|
112
84
|
|
113
|
-
|
114
|
-
lambda {
|
85
|
+
koncrete = Class.new(klass) { def response_throttled?; false; end }.new(Whois::Record::Part.new)
|
86
|
+
lambda { koncrete.validate! }.should_not raise_error
|
115
87
|
end
|
116
88
|
|
117
89
|
it "raises Whois::ResponseIsUnavailable when the response is unavailable" do
|
118
|
-
|
119
|
-
lambda {
|
90
|
+
koncrete = Class.new(klass) { def response_unavailable?; true; end }.new(Whois::Record::Part.new)
|
91
|
+
lambda { koncrete.validate! }.should raise_error(Whois::ResponseIsUnavailable)
|
120
92
|
|
121
|
-
|
122
|
-
lambda {
|
93
|
+
koncrete = Class.new(klass) { def response_unavailable?; false; end }.new(Whois::Record::Part.new)
|
94
|
+
lambda { koncrete.validate! }.should_not raise_error
|
123
95
|
end
|
124
96
|
end
|
125
97
|
|
@@ -170,13 +142,13 @@ describe Whois::Record::Parser::Base do
|
|
170
142
|
c1 = Whois::Record::Contact.new(:id => "1st", :name => "foo")
|
171
143
|
c2 = Whois::Record::Contact.new(:id => "2nd", :name => "foo")
|
172
144
|
c3 = Whois::Record::Contact.new(:id => "3rd", :name => "foo")
|
173
|
-
|
145
|
+
koncrete = Class.new(klass) do
|
174
146
|
property_supported(:registrant_contacts) { [c1, c2] }
|
175
147
|
property_supported(:admin_contacts) { [] }
|
176
148
|
property_supported(:technical_contacts) { [c3] }
|
177
149
|
end.new(@part)
|
178
150
|
|
179
|
-
|
151
|
+
koncrete.contacts.should == [c1, c2, c3]
|
180
152
|
end
|
181
153
|
|
182
154
|
it "returns an empty array when no contact is supported" do
|
@@ -21,9 +21,34 @@ describe Whois::Record::Parser::WhoisAero, "status_available.expected" do
|
|
21
21
|
@parser = klass.new(part)
|
22
22
|
end
|
23
23
|
|
24
|
+
describe "#disclaimer" do
|
25
|
+
it do
|
26
|
+
@parser.disclaimer.should == nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
describe "#domain" do
|
30
|
+
it do
|
31
|
+
@parser.domain.should == nil
|
32
|
+
end
|
33
|
+
end
|
34
|
+
describe "#domain_id" do
|
35
|
+
it do
|
36
|
+
@parser.domain_id.should == nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
describe "#referral_whois" do
|
40
|
+
it do
|
41
|
+
lambda { @parser.referral_whois }.should raise_error(Whois::PropertyNotSupported)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
describe "#referral_url" do
|
45
|
+
it do
|
46
|
+
lambda { @parser.referral_url }.should raise_error(Whois::PropertyNotSupported)
|
47
|
+
end
|
48
|
+
end
|
24
49
|
describe "#status" do
|
25
50
|
it do
|
26
|
-
@parser.status.should ==
|
51
|
+
@parser.status.should == []
|
27
52
|
end
|
28
53
|
end
|
29
54
|
describe "#available?" do
|
@@ -51,6 +76,29 @@ describe Whois::Record::Parser::WhoisAero, "status_available.expected" do
|
|
51
76
|
@parser.expires_on.should == nil
|
52
77
|
end
|
53
78
|
end
|
79
|
+
describe "#registrar" do
|
80
|
+
it do
|
81
|
+
@parser.registrar.should == nil
|
82
|
+
end
|
83
|
+
end
|
84
|
+
describe "#registrant_contacts" do
|
85
|
+
it do
|
86
|
+
@parser.registrant_contacts.should be_a(Array)
|
87
|
+
@parser.registrant_contacts.should == []
|
88
|
+
end
|
89
|
+
end
|
90
|
+
describe "#admin_contacts" do
|
91
|
+
it do
|
92
|
+
@parser.admin_contacts.should be_a(Array)
|
93
|
+
@parser.admin_contacts.should == []
|
94
|
+
end
|
95
|
+
end
|
96
|
+
describe "#technical_contacts" do
|
97
|
+
it do
|
98
|
+
@parser.technical_contacts.should be_a(Array)
|
99
|
+
@parser.technical_contacts.should == []
|
100
|
+
end
|
101
|
+
end
|
54
102
|
describe "#nameservers" do
|
55
103
|
it do
|
56
104
|
@parser.nameservers.should be_a(Array)
|
@@ -21,9 +21,34 @@ describe Whois::Record::Parser::WhoisAero, "status_registered.expected" do
|
|
21
21
|
@parser = klass.new(part)
|
22
22
|
end
|
23
23
|
|
24
|
+
describe "#disclaimer" do
|
25
|
+
it do
|
26
|
+
@parser.disclaimer.should == "Access to .AERO WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the Afilias registry database. The data in this record is provided by Afilias Limited for informational purposes only, and Afilias does not guarantee its accuracy. This service is intended only for query-based access. You agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to: (a) allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the data recipient's own existing customers; or (b) enable high volume, automated, electronic processes that send queries or data to the systems of Registry Operator, a Registrar, or Afilias except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. Afilias reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy."
|
27
|
+
end
|
28
|
+
end
|
29
|
+
describe "#domain" do
|
30
|
+
it do
|
31
|
+
@parser.domain.should == "srilankan.aero"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
describe "#domain_id" do
|
35
|
+
it do
|
36
|
+
@parser.domain_id.should == "D246-AERO"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
describe "#referral_whois" do
|
40
|
+
it do
|
41
|
+
lambda { @parser.referral_whois }.should raise_error(Whois::PropertyNotSupported)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
describe "#referral_url" do
|
45
|
+
it do
|
46
|
+
lambda { @parser.referral_url }.should raise_error(Whois::PropertyNotSupported)
|
47
|
+
end
|
48
|
+
end
|
24
49
|
describe "#status" do
|
25
50
|
it do
|
26
|
-
@parser.status.should ==
|
51
|
+
@parser.status.should == ["OK"]
|
27
52
|
end
|
28
53
|
end
|
29
54
|
describe "#available?" do
|
@@ -54,6 +79,71 @@ describe Whois::Record::Parser::WhoisAero, "status_registered.expected" do
|
|
54
79
|
@parser.expires_on.should == Time.parse("2010-03-26 06:48:27 UTC")
|
55
80
|
end
|
56
81
|
end
|
82
|
+
describe "#registrar" do
|
83
|
+
it do
|
84
|
+
@parser.registrar.should be_a(_registrar)
|
85
|
+
@parser.registrar.id.should == "380"
|
86
|
+
@parser.registrar.name.should == "Tuonome IT"
|
87
|
+
@parser.registrar.organization.should == "Tuonome IT"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
describe "#registrant_contacts" do
|
91
|
+
it do
|
92
|
+
@parser.registrant_contacts.should be_a(Array)
|
93
|
+
@parser.registrant_contacts.should have(1).items
|
94
|
+
@parser.registrant_contacts[0].should be_a(_contact)
|
95
|
+
@parser.registrant_contacts[0].type.should == Whois::Record::Contact::TYPE_REGISTRANT
|
96
|
+
@parser.registrant_contacts[0].id.should == "C4526901-AERO"
|
97
|
+
@parser.registrant_contacts[0].name.should == "Domain Name Administrator"
|
98
|
+
@parser.registrant_contacts[0].organization.should == "SriLankan Airlines Ltd"
|
99
|
+
@parser.registrant_contacts[0].address.should == "Admin Bldg"
|
100
|
+
@parser.registrant_contacts[0].city.should == "Katunayaka"
|
101
|
+
@parser.registrant_contacts[0].zip.should == "11450"
|
102
|
+
@parser.registrant_contacts[0].state.should == "WP"
|
103
|
+
@parser.registrant_contacts[0].country_code.should == "LK"
|
104
|
+
@parser.registrant_contacts[0].phone.should == "+94.197331600"
|
105
|
+
@parser.registrant_contacts[0].fax.should == "+94.197335160"
|
106
|
+
@parser.registrant_contacts[0].email.should == "domregister@srilankan.aero"
|
107
|
+
end
|
108
|
+
end
|
109
|
+
describe "#admin_contacts" do
|
110
|
+
it do
|
111
|
+
@parser.admin_contacts.should be_a(Array)
|
112
|
+
@parser.admin_contacts.should have(1).items
|
113
|
+
@parser.admin_contacts[0].should be_a(_contact)
|
114
|
+
@parser.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN
|
115
|
+
@parser.admin_contacts[0].id.should == "C4526901-AERO"
|
116
|
+
@parser.admin_contacts[0].name.should == "Domain Name Administrator"
|
117
|
+
@parser.admin_contacts[0].organization.should == "SriLankan Airlines Ltd"
|
118
|
+
@parser.admin_contacts[0].address.should == "Admin Bldg"
|
119
|
+
@parser.admin_contacts[0].city.should == "Katunayaka"
|
120
|
+
@parser.admin_contacts[0].zip.should == "11450"
|
121
|
+
@parser.admin_contacts[0].state.should == "WP"
|
122
|
+
@parser.admin_contacts[0].country_code.should == "LK"
|
123
|
+
@parser.admin_contacts[0].phone.should == "+94.197331600"
|
124
|
+
@parser.admin_contacts[0].fax.should == "+94.197335160"
|
125
|
+
@parser.admin_contacts[0].email.should == "domregister@srilankan.aero"
|
126
|
+
end
|
127
|
+
end
|
128
|
+
describe "#technical_contacts" do
|
129
|
+
it do
|
130
|
+
@parser.technical_contacts.should be_a(Array)
|
131
|
+
@parser.technical_contacts.should have(1).items
|
132
|
+
@parser.technical_contacts[0].should be_a(_contact)
|
133
|
+
@parser.technical_contacts[0].type.should == Whois::Record::Contact::TYPE_TECHNICAL
|
134
|
+
@parser.technical_contacts[0].id.should == "C4526901-AERO"
|
135
|
+
@parser.technical_contacts[0].name.should == "Domain Name Administrator"
|
136
|
+
@parser.technical_contacts[0].organization.should == "SriLankan Airlines Ltd"
|
137
|
+
@parser.technical_contacts[0].address.should == "Admin Bldg"
|
138
|
+
@parser.technical_contacts[0].city.should == "Katunayaka"
|
139
|
+
@parser.technical_contacts[0].zip.should == "11450"
|
140
|
+
@parser.technical_contacts[0].state.should == "WP"
|
141
|
+
@parser.technical_contacts[0].country_code.should == "LK"
|
142
|
+
@parser.technical_contacts[0].phone.should == "+94.197331600"
|
143
|
+
@parser.technical_contacts[0].fax.should == "+94.197335160"
|
144
|
+
@parser.technical_contacts[0].email.should == "domregister@srilankan.aero"
|
145
|
+
end
|
146
|
+
end
|
57
147
|
describe "#nameservers" do
|
58
148
|
it do
|
59
149
|
@parser.nameservers.should be_a(Array)
|
@@ -21,6 +21,31 @@ describe Whois::Record::Parser::WhoisAfiliasGrsInfo, "status_available.expected"
|
|
21
21
|
@parser = klass.new(part)
|
22
22
|
end
|
23
23
|
|
24
|
+
describe "#disclaimer" do
|
25
|
+
it do
|
26
|
+
@parser.disclaimer.should == nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
describe "#domain" do
|
30
|
+
it do
|
31
|
+
@parser.domain.should == nil
|
32
|
+
end
|
33
|
+
end
|
34
|
+
describe "#domain_id" do
|
35
|
+
it do
|
36
|
+
@parser.domain_id.should == nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
describe "#referral_whois" do
|
40
|
+
it do
|
41
|
+
lambda { @parser.referral_whois }.should raise_error(Whois::PropertyNotSupported)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
describe "#referral_url" do
|
45
|
+
it do
|
46
|
+
lambda { @parser.referral_url }.should raise_error(Whois::PropertyNotSupported)
|
47
|
+
end
|
48
|
+
end
|
24
49
|
describe "#status" do
|
25
50
|
it do
|
26
51
|
@parser.status.should == []
|
@@ -51,6 +76,29 @@ describe Whois::Record::Parser::WhoisAfiliasGrsInfo, "status_available.expected"
|
|
51
76
|
@parser.expires_on.should == nil
|
52
77
|
end
|
53
78
|
end
|
79
|
+
describe "#registrar" do
|
80
|
+
it do
|
81
|
+
@parser.registrar.should == nil
|
82
|
+
end
|
83
|
+
end
|
84
|
+
describe "#registrant_contacts" do
|
85
|
+
it do
|
86
|
+
@parser.registrant_contacts.should be_a(Array)
|
87
|
+
@parser.registrant_contacts.should == []
|
88
|
+
end
|
89
|
+
end
|
90
|
+
describe "#admin_contacts" do
|
91
|
+
it do
|
92
|
+
@parser.admin_contacts.should be_a(Array)
|
93
|
+
@parser.admin_contacts.should == []
|
94
|
+
end
|
95
|
+
end
|
96
|
+
describe "#technical_contacts" do
|
97
|
+
it do
|
98
|
+
@parser.technical_contacts.should be_a(Array)
|
99
|
+
@parser.technical_contacts.should == []
|
100
|
+
end
|
101
|
+
end
|
54
102
|
describe "#nameservers" do
|
55
103
|
it do
|
56
104
|
@parser.nameservers.should be_a(Array)
|