diff --git a/CHANGELOG.md b/CHANGELOG.md index c55632c73..7913a5efb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). @@ -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 diff --git a/lib/whois/record/parser.rb b/lib/whois/record/parser.rb index 9f83fbcf3..fa4a914d5 100644 --- a/lib/whois/record/parser.rb +++ b/lib/whois/record/parser.rb @@ -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, diff --git a/lib/whois/record/parser/example.rb b/lib/whois/record/parser/example.rb index 8cf01a3a5..9da3a8a45 100644 --- a/lib/whois/record/parser/example.rb +++ b/lib/whois/record/parser/example.rb @@ -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, diff --git a/lib/whois/record/parser/jobswhois.verisign-grs.com.rb b/lib/whois/record/parser/jobswhois.verisign-grs.com.rb index ab6c6df47..2995f3849 100644 --- a/lib/whois/record/parser/jobswhois.verisign-grs.com.rb +++ b/lib/whois/record/parser/jobswhois.verisign-grs.com.rb @@ -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 @@ -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. @@ -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 diff --git a/lib/whois/record/parser/whois.crsnic.net.rb b/lib/whois/record/parser/whois.crsnic.net.rb index 2a648e353..2c41c4da7 100644 --- a/lib/whois/record/parser/whois.crsnic.net.rb +++ b/lib/whois/record/parser/whois.crsnic.net.rb @@ -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 @@ -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. @@ -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. diff --git a/lib/whois/record/parser/whois.nic.cc.rb b/lib/whois/record/parser/whois.nic.cc.rb index 58deca678..511eb966a 100644 --- a/lib/whois/record/parser/whois.nic.cc.rb +++ b/lib/whois/record/parser/whois.nic.cc.rb @@ -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 @@ -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. diff --git a/lib/whois/record/parser/whois.nic.tv.rb b/lib/whois/record/parser/whois.nic.tv.rb index b58728ad7..5fd362f84 100644 --- a/lib/whois/record/parser/whois.nic.tv.rb +++ b/lib/whois/record/parser/whois.nic.tv.rb @@ -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 @@ -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.