-
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
68 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#-- | ||
# Ruby Whois | ||
# | ||
# An intelligent pure Ruby WHOIS client and parser. | ||
# | ||
# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net> | ||
#++ | ||
|
||
require 'whois/record/scanners/base' | ||
|
||
module Whois | ||
class Record | ||
module Scanners | ||
|
||
# Scanner for the whois.domainregistry.ie server. | ||
# | ||
# @since RELEASE | ||
class WhoisDomainregistryIe < Base | ||
|
||
self.tokenizers += [ | ||
:skip_empty_line, | ||
:scan_copyright, | ||
:scan_keyvalue, | ||
:scan_available, | ||
] | ||
|
||
tokenizer :scan_available do | ||
if @input.skip(/^% Not Registered - .+\n/) | ||
@ast["status:available"] = true | ||
end | ||
end | ||
|
||
tokenizer :scan_copyright do | ||
if @input.match?(/^% Rights restricted by copyright/) | ||
lines = [] | ||
while @input.scan(/^%(.+)\n/) | ||
lines << @input[1].strip | ||
end | ||
@ast["field:disclaimer"] = lines.join(" ") | ||
end | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |