Skip to content

Commit

Permalink
:referral_whois and :referral_url no longer exist as properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Nov 4, 2012
1 parent 3481033 commit 4b2fc17
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 60 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Expand Up @@ -41,6 +41,8 @@

- CHANGED: Whois::Server#query renamed to Whois::Server#lookup

- CHANGED: :referral_whois and :referral_url no longer exist as properties.

- FIXED: whois.domainregistry.ie should support status `Active - LOCKED`.

- FIXED: whois.nic.uk fails to parse registrars without URL (GH-188).
Expand All @@ -56,6 +58,13 @@

- Whois::Server#query has been renamed to Whois::Server#lookup

- :referral_whois and :referral_url no longer exist as properties.
The parsers where the propertie was supported still supports the property
by providing a corresponding method.

However, you cannot call the method on the response anymore.
Instead, you have to invoke the method directly on the parser instance.


## Release 2.7.0

Expand Down
4 changes: 2 additions & 2 deletions lib/whois/record/parser.rb
Expand Up @@ -24,13 +24,13 @@ class Parser
METHODS = [
:contacts,
:changed?, :unchanged?,
# :response_incomplete?, :response_throttled?, :response_unavailable?
# :response_incomplete?, :response_throttled?, :response_unavailable?,
# :referral_whois, :referral_url,
]

PROPERTIES = [
:disclaimer,
:domain, :domain_id,
:referral_whois, :referral_url,
:status, :available?, :registered?,
:created_on, :updated_on, :expires_on,
:registrar,
Expand Down
9 changes: 0 additions & 9 deletions lib/whois/record/parser/example.rb
Expand Up @@ -51,15 +51,6 @@ class Example < Base
end


property_supported :referral_whois do
nil
end

property_supported :referral_url do
nil
end


# Gets the record status or statuses.
#
# Returns a String/Array with the record status if available,
Expand Down
34 changes: 17 additions & 17 deletions lib/whois/record/parser/jobswhois.verisign-grs.com.rb
Expand Up @@ -31,17 +31,6 @@ class JobswhoisVerisignGrsCom < Base
property_not_supported :domain_id


property_supported :referral_whois do
node("Whois Server")
end

property_supported :referral_url do
node("Referral URL") do |raw|
last_useful_item(raw)
end
end


property_supported :status do
node("Status")
end
Expand Down Expand Up @@ -86,6 +75,17 @@ class JobswhoisVerisignGrsCom < Base
end


def referral_whois
node("Whois Server")
end

def referral_url
node("Referral URL") do |lines|
last_useful_item(lines)
end
end


# Initializes a new {Scanners::Verisign} instance
# passing the {#content_for_scanner}
# and calls +parse+ on it.
Expand All @@ -96,13 +96,13 @@ def parse
end


protected
private

# In case of "SPAM Response", the response contains more than one item
# for the same value and the value becomes an Array.
def last_useful_item(values)
values.is_a?(Array) ? values.last : values
end
# In case of "SPAM Response", the response contains more than one item
# for the same value and the value becomes an Array.
def last_useful_item(values)
values.is_a?(Array) ? values.last : values
end

end

Expand Down
25 changes: 12 additions & 13 deletions lib/whois/record/parser/whois.crsnic.net.rb
Expand Up @@ -31,18 +31,6 @@ class WhoisCrsnicNet < Base
property_not_supported :domain_id



property_supported :referral_whois do
node("Whois Server")
end

property_supported :referral_url do
node("Referral URL") do |raw|
last_useful_item(raw)
end
end


property_supported :status do
node("Status")
end
Expand Down Expand Up @@ -95,6 +83,17 @@ def response_unavailable?
!!node("response:unavailable")
end

def referral_whois
node("Whois Server")
end

def referral_url
node("Referral URL") do |lines|
last_useful_item(lines)
end
end


# Initializes a new {Scanners::Verisign} instance
# passing the {#content_for_scanner}
# and calls +parse+ on it.
Expand All @@ -105,7 +104,7 @@ def parse
end


private
private

# In case of "SPAM Response", the response contains more than one item
# for the same value and the value becomes an Array.
Expand Down
18 changes: 9 additions & 9 deletions lib/whois/record/parser/whois.nic.cc.rb
Expand Up @@ -31,15 +31,6 @@ class WhoisNicCc < Base
property_not_supported :domain_id


property_supported :referral_whois do
node("Whois Server")
end

property_supported :referral_url do
node("Referral URL")
end


property_supported :status do
node("Status")
end
Expand Down Expand Up @@ -80,6 +71,15 @@ class WhoisNicCc < Base
end


def referral_whois
node("Whois Server")
end

def referral_url
node("Referral URL")
end


# Initializes a new {Scanners::Verisign} instance
# passing the {#content_for_scanner}
# and calls +parse+ on it.
Expand Down
19 changes: 9 additions & 10 deletions lib/whois/record/parser/whois.nic.tv.rb
Expand Up @@ -31,16 +31,6 @@ class WhoisNicTv < Base
property_not_supported :domain_id



property_supported :referral_whois do
node("Whois Server")
end

property_supported :referral_url do
node("Referral URL")
end


property_supported :status do
node("Status")
end
Expand Down Expand Up @@ -81,6 +71,15 @@ class WhoisNicTv < Base
end


def referral_whois
node("Whois Server")
end

def referral_url
node("Referral URL")
end


# Initializes a new {Scanners::Verisign} instance
# passing the {#content_for_scanner}
# and calls +parse+ on it.
Expand Down

0 comments on commit 4b2fc17

Please sign in to comment.