whois 3.4.0 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/data/tld.json +4 -4
  5. data/lib/whois/record/parser/base_icann_compliant.rb +13 -15
  6. data/lib/whois/record/parser/whois.1und1.info.rb +30 -0
  7. data/lib/whois/record/parser/whois.ascio.com.rb +0 -3
  8. data/lib/whois/record/parser/whois.comlaude.com.rb +1 -0
  9. data/lib/whois/record/parser/whois.dk-hostmaster.dk.rb +2 -0
  10. data/lib/whois/record/parser/whois.enom.com.rb +4 -0
  11. data/lib/whois/record/parser/whois.gandi.net.rb +4 -119
  12. data/lib/whois/record/parser/whois.godaddy.com.rb +0 -3
  13. data/lib/whois/record/parser/whois.kenic.or.ke.rb +24 -16
  14. data/lib/whois/record/parser/whois.markmonitor.com.rb +1 -0
  15. data/lib/whois/record/parser/whois.networksolutions.com.rb +11 -125
  16. data/lib/whois/record/parser/whois.nic.hu.rb +18 -100
  17. data/lib/whois/record/parser/whois.pairnic.com.rb +30 -0
  18. data/lib/whois/record/parser/whois.rrpproxy.net.rb +0 -3
  19. data/lib/whois/record/parser/whois.schlund.info.rb +4 -0
  20. data/lib/whois/record/parser/whois.tucows.com.rb +30 -0
  21. data/lib/whois/record/parser/whois.udag.net.rb +4 -0
  22. data/lib/whois/record/parser/whois.wildwestdomains.com.rb +37 -0
  23. data/lib/whois/record/parser/whois.yoursrs.com.rb +0 -3
  24. data/lib/whois/record/scanners/base_icann_compliant.rb +4 -3
  25. data/lib/whois/record/scanners/scannable.rb +0 -1
  26. data/lib/whois/record/scanners/whois.tucows.com.rb +35 -0
  27. data/lib/whois/version.rb +1 -1
  28. data/whois.gemspec +6 -5
  29. metadata +36 -32
  30. data/lib/whois/record/scanners/whois.nic.hu.rb +0 -178
@@ -1,178 +0,0 @@
1
- #--
2
- # Ruby Whois
3
- #
4
- # An intelligent pure Ruby WHOIS client and parser.
5
- #
6
- # Copyright (c) 2009-2013 Simone Carletti <weppos@weppos.net>
7
- #++
8
-
9
-
10
- require 'whois/record/scanners/base'
11
-
12
-
13
- module Whois
14
- class Record
15
- module Scanners
16
-
17
- class WhoisNicHu < Base
18
-
19
- self.tokenizers += [
20
- :scan_version,
21
- :scan_disclaimer,
22
- :scan_domain,
23
- :scan_available,
24
- :scan_in_progress,
25
-
26
- # v2.0
27
- :scan_moreinfo,
28
-
29
- # v1.99
30
- :scan_domain_data,
31
- :scan_contacts,
32
-
33
- :skip_empty_line,
34
- ]
35
-
36
-
37
- # FIXME: Requires UTF-8 Encoding (see #11)
38
- tokenizer :scan_available do
39
- if @input.match?(/Nincs (.*?) \/ No match\n/)
40
- @input.skip(/Nincs (.*?) \/ No match\n/)
41
- @ast["status:available"] = true
42
- end
43
- end
44
-
45
- # FIXME: Requires UTF-8 Encoding (see #11)
46
- tokenizer :scan_in_progress do
47
- if @input.match?(/(.*?) folyamatban \/ Registration in progress\n/)
48
- @input.skip(/(.*?) folyamatban \/ Registration in progress\n/)
49
- @ast["status:inprogress"] = true
50
- end
51
- end
52
-
53
- tokenizer :scan_disclaimer do
54
- if @input.match?(/^Rights.*\n/)
55
- lines = @input.scan_until(/^\n/)
56
- @ast["field:disclaimer"] = lines.strip
57
- end
58
- end
59
-
60
- tokenizer :scan_domain do
61
- if @input.match?(/^domain:\s+(.*)\n/) && @input.scan(/^domain:\s+(.*?)\n/)
62
- @ast["field:domain"] = @input[1].strip
63
- end
64
- end
65
-
66
- # FIXME: Requires UTF-8 Encoding (see #11)
67
- tokenizer :scan_moreinfo do
68
- if @input.match?(/Tov.* ld\.:\n/)
69
- @ast["field:moreinfo"] = @input.scan_until(/^\n/)
70
- end
71
- end
72
-
73
- tokenizer :scan_version do
74
- if @input.match?(/% Whois server .*\n/)
75
- @input.scan(/% Whois server ([\w\d\.]*).*?\n/)
76
- @ast["field:version"] = @input[1]
77
- end
78
- end
79
-
80
- tokenizer :scan_domain_data do
81
- if @input.match?(/(.+?):\s+(.*)\n/)
82
- while @input.scan(/(.+?):\s+(.*)\n/)
83
- key, value = @input[1].strip, @input[2].strip
84
- if key == 'person'
85
- @ast['name'] = value
86
- elsif key == 'org'
87
- if value =~ /org_name_hun:\s+(.*)\Z/
88
- @ast['name'] = $1
89
- elsif value =~ /org_name_eng:\s+(.*)\Z/
90
- @ast['org'] = $1
91
- elsif value != 'Private person'
92
- contact['org'] = value
93
- end
94
- elsif @ast[key].nil?
95
- @ast[key] = value
96
- elsif @ast[key].is_a? Array
97
- @ast[key] << value
98
- else
99
- @ast[key] = [@ast[key], value].flatten
100
- end
101
- end
102
- true
103
- end
104
- end
105
-
106
- tokenizer :scan_contacts do
107
- if @input.match?(/\n(person|org):/)
108
- @input.scan(/\n/)
109
- while @input.match?(/(.+?):\s+(.*)\n/)
110
- parse_contact
111
- end
112
- true
113
- end
114
- end
115
-
116
-
117
- private
118
-
119
- def parse_contact
120
- contact ||= {}
121
- while @input.scan(/(.+?):\s+(.*)\n/)
122
- key, value = @input[1].strip, @input[2].strip
123
- if key == 'hun-id'
124
- a1 = contact['address'][1].split(/\s/)
125
- zip = a1.shift
126
- city = a1.join(' ')
127
- # we should keep the old values if this is an already
128
- # defined contact
129
- if @ast[value].nil?
130
- @ast[value] = {
131
- "id" => value,
132
- "name" => contact['name'],
133
- "organization" => contact['org'],
134
- "address" => contact['address'][0],
135
- "city" => city,
136
- "zip" => zip,
137
- "country_code" => contact['address'][2],
138
- "phone" => contact['phone'],
139
- "fax" => contact['fax-no'],
140
- "email" => contact['e-mail']
141
- }
142
- else
143
- @ast[value]["id"] ||= value
144
- @ast[value]["name"] ||= contact['name']
145
- @ast[value]["organization"] ||= contact['org']
146
- @ast[value]["address"] ||= contact['address'][0]
147
- @ast[value]["city"] ||= city
148
- @ast[value]["zip"] ||= zip
149
- @ast[value]["country_code"] ||= contact['address'][2]
150
- @ast[value]["phone"] ||= contact['phone']
151
- @ast[value]["fax"] ||= contact['fax-no']
152
- @ast[value]["email"] ||= contact['e-mail']
153
- end
154
- contact = {}
155
- elsif key == 'person'
156
- contact['name'] = value
157
- elsif key == 'org'
158
- if value =~ /org_name_hun:\s+(.*)\Z/
159
- contact['name'] = $1
160
- elsif value =~ /org_name_eng:\s+(.*)\Z/
161
- contact['org'] = $1
162
- else
163
- contact['org'] = value
164
- end
165
- elsif key == 'address' && !contact['address'].nil?
166
- contact['address'] = [contact['address'], value].flatten
167
- else
168
- contact[key] = value
169
- end
170
- end
171
- true
172
- end
173
-
174
- end
175
-
176
- end
177
- end
178
- end