Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add .BI server and parser (closes GH-113)

  • Loading branch information...
commit 7e2a99ae317e450d755405d1c7c0b2df3e6d151b 2 parents d6f8df2 + f0124ba
@weppos authored
View
4 CHANGELOG.md
@@ -6,6 +6,8 @@
* SERVER: Added .XN--MGB9AWBF (عمان, Oman) IDN TLD server.
+* SERVER: Added .BI TLD server (GH-113).
+
* NEW: Added full whois.register.com parser.
* NEW: Added full whois.tucows.com parser.
@@ -14,6 +16,8 @@
* NEW: Added full whois.cmc.iq parser (GH-171).
+* NEW: Added full whois1.nic.bi parser (GH-113).
+
* FIXED: Fixed whois.register.com parser for enom formats (GH-181). [Thanks @JustinCampbell]
* FIXED: whois.jprs.js parser should support status `Suspended`.
View
2  lib/whois/definitions/tlds.rb
@@ -75,7 +75,7 @@
Whois::Server.define :tld, ".bf", nil, { :adapter => :none }
Whois::Server.define :tld, ".bg", "whois.register.bg"
Whois::Server.define :tld, ".bh", nil, { :adapter => :none }
-Whois::Server.define :tld, ".bi", nil, { :adapter => :web, :url => "https://whois.nic.bi/whois.php" }
+Whois::Server.define :tld, ".bi", "whois1.nic.bi"
Whois::Server.define :tld, ".bj", "whois.nic.bj"
Whois::Server.define :tld, ".bm", nil, { :adapter => :web, :url => "http://207.228.133.14/cgi-bin/lansaweb?procfun+BMWHO+BMWHO2+WHO" }
Whois::Server.define :tld, ".bn", nil, { :adapter => :none }
View
23 lib/whois/record/parser/whois1.nic.bi.rb
@@ -0,0 +1,23 @@
+#--
+# Ruby Whois
+#
+# An intelligent pure Ruby WHOIS client and parser.
+#
+# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
+#++
+
+
+require 'whois/record/parser/base_cocca'
+
+
+module Whois
+ class Record
+ class Parser
+
+ # Parser for the whois1.nic.bi server.
+ class Whois1NicBi < BaseCocca
+ end
+
+ end
+ end
+end
View
9 spec/fixtures/responses/whois.nic.bi/available1.txt
@@ -0,0 +1,9 @@
+
+Whois Server Version 1.0
+
+This whois server contains a sample load of data from the zone.
+All data returned is for example and testing only.
+
+No match for "U34JEDZCQ.BI".
+
+This data is for testing and validation purposes ONLY
View
16 spec/fixtures/responses/whois.nic.bi/registered1.txt
@@ -0,0 +1,16 @@
+
+Whois Server Version 1.0
+
+This whois server contains a sample load of data from the zone.
+All data returned is for example and testing only.
+
+ Domain Name: GOOGLE.BI
+ Registrar: MarkMonitor
+ Whois Server: BI-10068
+ Referral URL: www.markmonitor.com
+ Name Server: ns4.google.com
+ Name Server: ns3.google.com
+ Name Server: ns1.google.com
+ Name Server: ns2.google.com
+
+This data is for testing and validation purposes ONLY
View
11 spec/fixtures/responses/whois.nic.bi/registered2.txt
@@ -0,0 +1,11 @@
+
+Whois Server Version 1.0
+
+This whois server contains a sample load of data from the zone.
+All data returned is for example and testing only.
+
+ Domain Name: TUBANE.BI
+ Registrar: CBINET
+ Referral URL: www.cbinet.bi
+
+This data is for testing and validation purposes ONLY
View
11 spec/fixtures/responses/whois.nic.bi/registered3.txt
@@ -0,0 +1,11 @@
+
+Whois Server Version 1.0
+
+This whois server contains a sample load of data from the zone.
+All data returned is for example and testing only.
+
+ Domain Name: BCB.BI
+ Registrar: CBINET
+ Referral URL: www.cbinet.bi
+
+This data is for testing and validation purposes ONLY
View
12 spec/fixtures/responses/whois.nic.bi/registered4.txt
@@ -0,0 +1,12 @@
+
+Whois Server Version 1.0
+
+This whois server contains a sample load of data from the zone.
+All data returned is for example and testing only.
+
+ Domain Name: CECOS.BI
+ Registrar: Afriregister
+ Whois Server: BI-10076
+ Referral URL: www.afriregister.bi
+
+This data is for testing and validation purposes ONLY
View
30 spec/fixtures/responses/whois1.nic.bi/status_available.expected
@@ -0,0 +1,30 @@
+#domain
+ should: %s == "u34jedzcq.bi"
+
+#domain_id
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+
+#status
+ should: %s == :available
+
+#available?
+ should: %s == true
+
+#registered?
+ should: %s == false
+
+
+#created_on
+ should: %s == nil
+
+#updated_on
+ should: %s == nil
+
+#expires_on
+ should: %s == nil
+
+
+#nameservers
+ should: %s CLASS(array)
+ should: %s == []
View
12 spec/fixtures/responses/whois1.nic.bi/status_available.txt
@@ -0,0 +1,12 @@
+TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by NIC.BI as a service to the internet community on behalf of Burundi cctld.)
+
+The data is for information purposes only. NIC.BI does not guarantee its accuracy. By submitting a Whois query, you agree to abide by the following terms of use: You agree that you may use this Data only for lawful purposes and that under no circumstances will you use this Data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes
+
+The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.
+
+Domain Information
+Query: u34jedzcq.bi
+Status: Not Registered
+
+
+
View
48 spec/fixtures/responses/whois1.nic.bi/status_registered.expected
@@ -0,0 +1,48 @@
+#domain
+ should: %s == "google.bi"
+
+#domain_id
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+
+#status
+ should: %s == :registered
+
+#available?
+ should: %s == false
+
+#registered?
+ should: %s == true
+
+
+#created_on
+ should: %s CLASS(time)
+ should: %s == Time.parse("2002-09-30")
+
+#updated_on
+ should: %s CLASS(time)
+ should: %s == Time.parse("2012-08-30")
+
+#expires_on
+ should: %s CLASS(time)
+ should: %s == Time.parse("2013-09-30")
+
+
+#registrar
+ should: %s CLASS(registrar)
+ should: %s.id == nil
+ should: %s.name == "MarkMonito"
+ should: %s.url == nil
+
+
+#nameservers
+ should: %s CLASS(array)
+ should: %s SIZE(4)
+ should: %s[0] CLASS(nameserver)
+ should: %s[0].name == "ns1.google.com"
+ should: %s[1] CLASS(nameserver)
+ should: %s[1].name == "ns2.google.com"
+ should: %s[2] CLASS(nameserver)
+ should: %s[2].name == "ns3.google.com"
+ should: %s[3] CLASS(nameserver)
+ should: %s[3].name == "ns4.google.com"
View
29 spec/fixtures/responses/whois1.nic.bi/status_registered.txt
@@ -0,0 +1,29 @@
+TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by NIC.BI as a service to the internet community on behalf of Burundi cctld.)
+
+The data is for information purposes only. NIC.BI does not guarantee its accuracy. By submitting a Whois query, you agree to abide by the following terms of use: You agree that you may use this Data only for lawful purposes and that under no circumstances will you use this Data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes
+
+The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.
+
+Domain Information
+Query: google.bi
+Status: Delegated
+Created: 30 Sep 2002
+Modified: 30 Aug 2012
+Expires: 30 Sep 2013
+Name Servers:
+ ns1.google.com
+ ns2.google.com
+ ns3.google.com
+ ns4.google.com
+
+Registrar Information
+Registrar Name: MarkMonito
+Country: US
+
+
+
+
+Registrant:
+Email Address: dns-admin AT google DOT com
+Phone Number: 1.650253
+
View
70 spec/whois/record/parser/responses/whois1.nic.bi/status_available_spec.rb
@@ -0,0 +1,70 @@
+# 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/whois1.nic.bi/status_available.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois1.nic.bi.rb'
+
+describe Whois::Record::Parser::Whois1NicBi, "status_available.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois1.nic.bi/status_available.txt")
+ part = Whois::Record::Part.new(:body => File.read(file))
+ @parser = klass.new(part)
+ end
+
+ describe "#domain" do
+ it do
+ @parser.domain.should == "u34jedzcq.bi"
+ end
+ end
+ describe "#domain_id" do
+ it do
+ lambda { @parser.domain_id }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
+ describe "#status" do
+ it do
+ @parser.status.should == :available
+ end
+ end
+ describe "#available?" do
+ it do
+ @parser.available?.should == true
+ end
+ end
+ describe "#registered?" do
+ it do
+ @parser.registered?.should == false
+ end
+ end
+ describe "#created_on" do
+ it do
+ @parser.created_on.should == nil
+ end
+ end
+ describe "#updated_on" do
+ it do
+ @parser.updated_on.should == nil
+ end
+ end
+ describe "#expires_on" do
+ it do
+ @parser.expires_on.should == nil
+ end
+ end
+ describe "#nameservers" do
+ it do
+ @parser.nameservers.should be_a(Array)
+ @parser.nameservers.should == []
+ end
+ end
+end
View
89 spec/whois/record/parser/responses/whois1.nic.bi/status_registered_spec.rb
@@ -0,0 +1,89 @@
+# 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/whois1.nic.bi/status_registered.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois1.nic.bi.rb'
+
+describe Whois::Record::Parser::Whois1NicBi, "status_registered.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois1.nic.bi/status_registered.txt")
+ part = Whois::Record::Part.new(:body => File.read(file))
+ @parser = klass.new(part)
+ end
+
+ describe "#domain" do
+ it do
+ @parser.domain.should == "google.bi"
+ end
+ end
+ describe "#domain_id" do
+ it do
+ lambda { @parser.domain_id }.should raise_error(Whois::PropertyNotSupported)
+ end
+ 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
+ describe "#created_on" do
+ it do
+ @parser.created_on.should be_a(Time)
+ @parser.created_on.should == Time.parse("2002-09-30")
+ end
+ end
+ describe "#updated_on" do
+ it do
+ @parser.updated_on.should be_a(Time)
+ @parser.updated_on.should == Time.parse("2012-08-30")
+ end
+ end
+ describe "#expires_on" do
+ it do
+ @parser.expires_on.should be_a(Time)
+ @parser.expires_on.should == Time.parse("2013-09-30")
+ end
+ end
+ describe "#registrar" do
+ it do
+ @parser.registrar.should be_a(Whois::Record::Registrar)
+ @parser.registrar.id.should == nil
+ @parser.registrar.name.should == "MarkMonito"
+ @parser.registrar.url.should == nil
+ end
+ end
+ describe "#nameservers" do
+ it do
+ @parser.nameservers.should be_a(Array)
+ @parser.nameservers.should have(4).items
+ @parser.nameservers[0].should be_a(Whois::Record::Nameserver)
+ @parser.nameservers[0].name.should == "ns1.google.com"
+ @parser.nameservers[1].should be_a(Whois::Record::Nameserver)
+ @parser.nameservers[1].name.should == "ns2.google.com"
+ @parser.nameservers[2].should be_a(Whois::Record::Nameserver)
+ @parser.nameservers[2].name.should == "ns3.google.com"
+ @parser.nameservers[3].should be_a(Whois::Record::Nameserver)
+ @parser.nameservers[3].name.should == "ns4.google.com"
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.