Not working on 1.9.2 on OSX #88

Closed
rb2k opened this Issue Mar 18, 2011 · 4 comments

Comments

Projects
None yet
2 participants

rb2k commented Mar 18, 2011

Hm, I can't get most of the examples to work :(

$ gem search whois
*** LOCAL GEMS ***
whois (2.0.1)

Here are my tries:

$ irb
ruby-1.9.2-p136 :001 > require "whois"
 => true 
ruby-1.9.2-p136 :002 > r = Whois.whois("google.it")
 => "" 
ruby-1.9.2-p136 :003 > r.name
NoMethodError: undefined method `name' for "":Whois::Record
    from /Users/mseeger/.rvm/gems/ruby-1.9.2-p136/gems/whois-2.0.1/lib/whois/record.rb:329:in `method_missing'
    from (irb):3
    from /Users/mseeger/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>'
ruby-1.9.2-p136 :004 > 

or

ruby-1.9.2-p136 :003 > r = Whois.whois("simoncarletti.com")
 => "\nWhois Server Version 2.0\n\nDomain names in the .com and .net domains can now be registered\nwith many different competing registrars. Go to http://www.internic.net\nfor detailed information.\n\nNo match for \"SIMONCARLETTI.COM\".\n>>> Last update of whois database: Fri, 18 Mar 2011 08:57:38 UTC <<<\n\nNOTICE: The expiration date displayed in this record is the date the \nregistrar's sponsorship of the domain name registration in the registry is \ncurrently set to expire. This date does not necessarily reflect the expiration \ndate of the domain name registrant's agreement with the sponsoring \nregistrar.  Users may consult the sponsoring registrar's Whois database to \nview the registrar's reported date of expiration for this registration.\n\nTERMS OF USE: You are not authorized to access or query our Whois \ndatabase through the use of electronic processes that are high-volume and \nautomated except as reasonably necessary to register domain names or \nmodify existing registrations; the Data in VeriSign Global Registry \nServices' (\"VeriSign\") Whois database is provided by VeriSign for \ninformation purposes only, and to assist persons in obtaining information \nabout or related to a domain name registration record. VeriSign does not \nguarantee its accuracy. By submitting a Whois query, you agree to abide \nby the following terms of use: You agree that you may use this Data only \nfor lawful purposes and that under no circumstances will you use this Data \nto: (1) allow, enable, or otherwise support the transmission of mass \nunsolicited, commercial advertising or solicitations via e-mail, telephone, \nor facsimile; or (2) enable high volume, automated, electronic processes \nthat apply to VeriSign (or its computer systems). The compilation, \nrepackaging, dissemination or other use of this Data is expressly \nprohibited without the prior written consent of VeriSign. You agree not to \nuse electronic processes that are automated and high-volume to access or \nquery the Whois database except as reasonably necessary to register \ndomain names or modify existing registrations. VeriSign reserves the right \nto restrict your access to the Whois database in its sole discretion to ensure \noperational stability.  VeriSign may restrict or terminate your access to the \nWhois database for failure to abide by these terms of use. VeriSign \nreserves the right to modify these terms at any time. \n\nThe Registry database contains ONLY .COM, .NET, .EDU domains and\nRegistrars." 
ruby-1.9.2-p136 :004 > r.id
NoMethodError: undefined method `id' for #<Whois::Record:0x00000100a793c8>
from /Users/mseeger/.rvm/gems/ruby-1.9.2-p136/gems/whois-2.0.1/lib/whois/record.rb:329:in `method_missing'
from (irb):4
from /Users/mseeger/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>'
ruby-1.9.2-p136 :005 > r.name
NoMethodError: undefined method `name' for #<Whois::Record:0x00000100a793c8>
from /Users/mseeger/.rvm/gems/ruby-1.9.2-p136/gems/whois-2.0.1/lib/whois/record.rb:329:in `method_missing'
from (irb):5
from /Users/mseeger/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>'

or

ruby-1.9.2-p136 :011 > r = Whois.whois("google.it")
 => "\n\n*********************************************************************\n* Please note that the following result could be a subgroup of      *\n* the data contained in the database.                               *\n*                                                                   *\n* Additional information can be visualized at:                      *\n* http://www.nic.it/cgi-bin/Whois/whois.cgi                         *\n*********************************************************************\n\nDomain:             google.it\nStatus:             ok\nCreated:            1999-12-10 00:00:00\nLast Update:        2010-12-13 01:11:33\nExpire Date:        2011-11-27\n\nRegistrant\n  Name:             Google Ireland Holdings\n  Organization:     Google Ireland Holdings\n  ContactID:        GOOG175\n  Address:          70 Sir John Rogersons Quay\n                    Dublin\n                    2\n                    IE\n                    IE\n  Created:          2008-11-27 16:47:22\n  Last Update:      2011-01-12 07:57:37\n\nAdmin Contact\n  Name:             Tsao Tu\n  Organization:     Tu Tsao\n  ContactID:        TT4277\n  Address:          70 Sir John Rogersons Quay\n                    Dublin\n                    2\n                    IE\n                    IE\n  Created:          2008-11-27 16:47:22\n  Last Update:      2011-01-12 07:58:12\n\nTechnical Contacts\n  Name:             Technical Support\n  Organization:     Register.it S.p.A.\n  ContactID:        2409-REGT\n  Address:          Via Montessori s/n\n                    Bergamo\n                    24126\n                    BG\n                    IT\n  Created:          2009-09-28 11:01:09\n  Last Update:      2009-09-28 11:01:09\n\nRegistrar\n  Organization:     Register.it s.p.a.\n  Name:             REGISTER-REG\n\nNameservers\n  ns1.google.com\n  ns4.google.com\n  ns2.google.com\n  ns3.google.com\n\n" 
ruby-1.9.2-p136 :012 > r.id
NoMethodError: undefined method `id' for #<Whois::Record:0x000001009b8bc8>
from /Users/mseeger/.rvm/gems/ruby-1.9.2-p136/gems/whois-2.0.1/lib/whois/record.rb:329:in `method_missing'
from (irb):12
from /Users/mseeger/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>'
ruby-1.9.2-p136 :013 > r.name
NoMethodError: undefined method `name' for #<Whois::Record:0x000001009b8bc8>
from /Users/mseeger/.rvm/gems/ruby-1.9.2-p136/gems/whois-2.0.1/lib/whois/record.rb:329:in `method_missing'
from (irb):13
from /Users/mseeger/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>'
ruby-1.9.2-p136 :014 > r.servers.class
NoMethodError: undefined method `servers' for #<Whois::Record:0x000001009b8bc8>
from /Users/mseeger/.rvm/gems/ruby-1.9.2-p136/gems/whois-2.0.1/lib/whois/record.rb:329:in `method_missing'
from (irb):14
from /Users/mseeger/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>'
Owner

weppos commented Mar 18, 2011

Where did you find the #id, #name and #servers methods? They don't exist on Record.

Please carefully follow the documentation.#name is a property of a Contact, not of a Record.

r = Whois.whois("google.it")
# => #<Whois::Record ...>

r.available?
# => false
r.registered?
# => true

r.created_on
# => Fri Dec 10 00:00:00 +0100 1999

t = r.technical_contact
# => #<Whois::Record::Contact ...>
t.id
# => "TS7016-ITNIC"
t.name
# => "Technical Services"

r.nameservers.each do |nameserver|
  puts nameserver
end

weppos closed this Mar 18, 2011

rb2k commented Mar 18, 2011

Sorry, probably not enough coffee yet :)

Google.it still seems to be a bit strange:
> r = Whois.whois("google.it")
=> "\n\n********************************************************************\n Please note that the following result could be a subgroup of \n the data contained in the database. \n \n Additional information can be visualized at: \n http://www.nic.it/cgi-bin/Whois/whois.cgi \n********************************************************************\n\nDomain: google.it\nStatus: ok\nCreated: 1999-12-10 00:00:00\nLast Update: 2010-12-13 01:11:33\nExpire Date: 2011-11-27\n\nRegistrant\n Name: Google Ireland Holdings\n Organization: Google Ireland Holdings\n ContactID: GOOG175\n Address: 70 Sir John Rogersons Quay\n Dublin\n 2\n IE\n IE\n Created: 2008-11-27 16:47:22\n Last Update: 2011-01-12 07:57:37\n\nAdmin Contact\n Name: Tsao Tu\n Organization: Tu Tsao\n ContactID: TT4277\n Address: 70 Sir John Rogersons Quay\n Dublin\n 2\n IE\n IE\n Created: 2008-11-27 16:47:22\n Last Update: 2011-01-12 07:58:12\n\nTechnical Contacts\n Name: Technical Support\n Organization: Register.it S.p.A.\n ContactID: 2409-REGT\n Address: Via Montessori s/n\n Bergamo\n 24126\n BG\n IT\n Created: 2009-09-28 11:01:09\n Last Update: 2009-09-28 11:01:09\n\nRegistrar\n Organization: Register.it s.p.a.\n Name: REGISTER-REG\n\nNameservers\n ns1.google.com\n ns4.google.com\n ns2.google.com\n ns3.google.com\n\n"
ruby-1.9.2-p136 :008 > r.technical
NoMethodError: undefined method technical' for #<Whois::Record:0x00000100a1faa8> from /Users/mseeger/.rvm/gems/ruby-1.9.2-p136/gems/whois-2.0.1/lib/whois/record.rb:329:inmethod_missing'
from (irb):8
from /Users/mseeger/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `

'

Owner

weppos commented Mar 18, 2011

It's not #technical, it's #technical_contact. The example was wrong.

rb2k commented Mar 18, 2011

thanks, that solves the problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment