-
-
Notifications
You must be signed in to change notification settings - Fork 283
/
whois.biz.rb
49 lines (37 loc) · 918 Bytes
/
whois.biz.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
#++
require 'whois/record/parser/scanners/base'
module Whois
class Record
class Parser
module Scanners
class WhoisBiz < Base
self.tokenizers += [
:skip_empty_line,
:scan_available,
:scan_keyvalue,
:skip_lastupdate,
:skip_fuffa,
]
tokenizer :scan_available do
if @input.scan(/^Not found: (.+)\n/)
@ast["Domain Name"] = @input[1]
@ast["status:available"] = true
end
end
tokenizer :skip_lastupdate do
@input.skip(/>>>(.+?)<<<\n/)
end
tokenizer :skip_fuffa do
@input.scan(/^\S(.+)\n/)
end
end
end
end
end
end