Skip to content

Commit

Permalink
Standardized whois.nic.gov #status property.
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Oct 17, 2010
1 parent 3cca713 commit 52a9372
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
$ ruby-whois hosteurope.de
% Error: 55000000013 Invalid charset for response

* CHANGED: Standardized whois.nic.gov #status property.


== Release 1.3.9

Expand Down
12 changes: 9 additions & 3 deletions lib/whois/answer/parser/whois.nic.gov.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,19 @@ class Parser
class WhoisNicGov < Base

property_supported :status do
@status ||= if content_for_scanner =~ /Status:\s(.*?)\n+/
$1.downcase.to_sym
@status ||= if content_for_scanner =~ /Status:\s+(.+?)\n/
case $1.downcase
when "active" then :registered
else
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
else
:available
end
end

property_supported :available? do
@registered ||= !registered?
@available ||= !registered?
end

property_supported :registered? do
Expand Down

0 comments on commit 52a9372

Please sign in to comment.