Skip to content
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
56 changes: 56 additions & 0 deletions lib/whois/parsers/whois.nominalia.com.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
#++


require_relative 'base_icann_compliant'


module Whois
class Parsers

class WhoisNominaliaCom < BaseIcannCompliant
self.scanner = Scanners::BaseIcannCompliant, {
pattern_available: /^No match for /
}

property_supported :registrant_contacts do
build_contact("Registrant", Parser::Contact::TYPE_REGISTRANT)
end

property_supported :admin_contacts do
build_contact("Admin", Parser::Contact::TYPE_ADMINISTRATIVE)
end

property_supported :technical_contacts do
build_contact("Tech", Parser::Contact::TYPE_TECHNICAL)
end

private

def build_contact(element, type)
node("#{element} Name") do
Parser::Contact.new(
type: type,
id: node("Registry #{element} ID").presence,
name: value_for_property(element, 'Name'),
organization: value_for_property(element, 'Organization'),
address: value_for_property(element, 'Street'),
city: value_for_property(element, 'City'),
zip: value_for_property(element, 'Postal Code'),
state: value_for_property(element, 'State/Province'),
country_code: value_for_property(element, 'Country'),
phone: value_for_phone_property(element, 'Phone'),
fax: value_for_phone_property(element, 'Fax'),
email: value_for_property(element, 'Email')
)
end
end

end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#domain
%s == nil

#domain_id
%s == nil

#status
%s == :available

#available?
%s == true

#registered?
%s == false

#created_on
%s == nil

#updated_on
%s == nil

#expires_on
%s == nil

#registrar
%s == nil

#registrant_contacts
%s %CLASS{array}
%s == []

#admin_contacts
%s %CLASS{array}
%s == []

#technical_contacts
%s %CLASS{array}
%s == []

#nameservers
%s %CLASS{array}
%s == []
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No match for "u34jedzcq.com".
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#domain
%s == "nominalia.com"

#domain_id
%s == "4546874_DOMAIN_COM-VRSN"

#status
%s == :registered

#available?
%s == false

#registered?
%s == true

#created_on
%s %CLASS{time}
%s %TIME{2008-02-07 00:00:00 UTC}

#updated_on
%s %CLASS{time}
%s %TIME{2013-06-27 00:00:00 UTC}

#expires_on
%s %CLASS{time}
%s %TIME{2018-11-30 00:00:00 UTC}

#registrar
%s %CLASS{registrar}
%s.id == "76"
%s.name == "NOMINALIA INTERNET S.L."
%s.organization == "NOMINALIA INTERNET S.L."
%s.url == "http://www.nominalia.com"

#registrant_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Parser::Contact::TYPE_REGISTRANT
%s[0].name == "Nominalia Internet S.L."
%s[0].organization == "Nominalia Internet S.L."
%s[0].address == "Josep Pla, 2. Torres Diagonal Litoral, B3, 3D"
%s[0].city == "Barcelona"
%s[0].zip == "L3R 8B5"
%s[0].state == "ON"
%s[0].country_code == "ES"
%s[0].phone == "+34.935074360"
%s[0].fax == "+34.933102360"
%s[0].email == "gestiontld@nominalia.com"

#admin_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Parser::Contact::TYPE_ADMINISTRATIVE
%s[0].name == "Claudio Corbetta"
%s[0].organization == "Nominalia Internet S.L."
%s[0].address == "Josep Pla, 2. Torres Diagonal Litoral, B3, 3D"
%s[0].city == "Barcelona"
%s[0].zip == "L3R 8B5"
%s[0].state == "ON"
%s[0].country_code == "ES"
%s[0].phone == "+34.935074360"
%s[0].fax == "+34.933102360"
%s[0].email == "gestiontld@nominalia.com"

#technical_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Parser::Contact::TYPE_TECHNICAL
%s[0].name == "Billing Department"
%s[0].organization == "Nominalia Internet, S.L."
%s[0].address == "Josep Pla, 2. Torres Diagonal Litoral. Edificio B3, planta 3-D"
%s[0].city == "Barcelona"
%s[0].zip == "L3R 8B5"
%s[0].state == "ON"
%s[0].country_code == "ES"
%s[0].phone == "+34.935074360"
%s[0].fax == "+34.933102360"
%s[0].email == "gestiontld@nominalia.com"

#nameservers
%s %CLASS{array}
%s %SIZE{2}
%s[0] %CLASS{nameserver}
%s[0].name == "dns1.nameresolvers.com"
%s[1] %CLASS{nameserver}
%s[1].name == "dns2.nameresolvers.com"
59 changes: 59 additions & 0 deletions spec/fixtures/responses/whois.nominalia.com/status_registered.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Domain Name: NOMINALIA.COM
Registry Domain ID: 4546874_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.nominalia.com
Registrar URL: http://www.nominalia.com
Updated Date: 2013-06-27T00:00:00Z
Creation Date: 2008-02-07T00:00:00Z
Registrar Registration Expiration Date: 2018-11-30T00:00:00Z
Registrar: NOMINALIA INTERNET S.L.
Registrar IANA ID: 76
Registrar Abuse Contact Email: abuse@nominalia.com
Registrar Abuse Contact Phone: +34.935074387
Reseller:
Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
Registry Registrant ID:
Registrant Name: Nominalia Internet S.L.
Registrant Organization: Nominalia Internet S.L.
Registrant Street: Josep Pla, 2. Torres Diagonal Litoral, B3, 3D
Registrant City: Barcelona
Registrant State/Province: B
Registrant Postal Code: ES-08019
Registrant Country: ES
Registrant Phone: +34.935074360
Registrant Phone Ext:
Registrant Fax: +34.933102360
Registrant Fax Ext:
Registrant Email: gestiontld@nominalia.com
Registry Admin ID:
Admin Name: Claudio Corbetta
Admin Organization: Nominalia Internet S.L.
Admin Street: Josep Pla, 2. Torres Diagonal Litoral, B3, 3D
Admin City: Barcelona
Admin State/Province: B
Admin Postal Code: 08019
Admin Country: ES
Admin Phone: +34.935074360
Admin Phone Ext:
Admin Fax: +34.933102360
Admin Fax Ext:
Admin Email: gestiontld@nominalia.com
Registry Tech ID:
Tech Name: Billing Department
Tech Organization: Nominalia Internet, S.L.
Tech Street: Josep Pla, 2. Torres Diagonal Litoral. Edificio B3, planta 3-D
Tech City: Barcelona
Tech State/Province: Barcelona
Tech Postal Code: 08019
Tech Country: ES
Tech Phone: +34.935074360
Tech Phone Ext:
Tech Fax: +34.933102360
Tech Fax Ext:
Tech Email: payment@nominalia.com
Name Server: DNS1.NOMINALIA.COM
Name Server: DNS2.NOMINALIA.COM
DNSSEC: unsigned
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
>>> Last update of whois database: 2018-05-03T10:01:43Z <<<

For more information on Whois status codes, please visit https://icann.org/epp
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# 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.nominalia.com/status_available.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#

require 'spec_helper'
require 'whois/parsers/whois.nominalia.com.rb'

describe Whois::Parsers::WhoisNominaliaCom, "status_available.expected" do

subject do
file = fixture("responses", "whois.nominalia.com/status_available.txt")
part = Whois::Record::Part.new(body: File.read(file))
described_class.new(part)
end

describe "#domain" do
it do
expect(subject.domain).to eq(nil)
end
end
describe "#domain_id" do
it do
expect(subject.domain_id).to eq(nil)
end
end
describe "#status" do
it do
expect(subject.status).to eq(:available)
end
end
describe "#available?" do
it do
expect(subject.available?).to eq(true)
end
end
describe "#registered?" do
it do
expect(subject.registered?).to eq(false)
end
end
describe "#created_on" do
it do
expect(subject.created_on).to eq(nil)
end
end
describe "#updated_on" do
it do
expect(subject.updated_on).to eq(nil)
end
end
describe "#expires_on" do
it do
expect(subject.expires_on).to eq(nil)
end
end
describe "#registrar" do
it do
expect(subject.registrar).to eq(nil)
end
end
describe "#registrant_contacts" do
it do
expect(subject.registrant_contacts).to be_a(Array)
expect(subject.registrant_contacts).to eq([])
end
end
describe "#admin_contacts" do
it do
expect(subject.admin_contacts).to be_a(Array)
expect(subject.admin_contacts).to eq([])
end
end
describe "#technical_contacts" do
it do
expect(subject.technical_contacts).to be_a(Array)
expect(subject.technical_contacts).to eq([])
end
end
describe "#nameservers" do
it do
expect(subject.nameservers).to be_a(Array)
expect(subject.nameservers).to eq([])
end
end
end
Loading