35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/pepper/commands.rb', line 35
def check(*domains)
login unless @logged_in
builder = Nokogiri::XML::Builder.new do |xml|
xml.epp("xmlns" => "urn:ietf:params:xml:ns:epp-1.0",
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
"xsi:schemaLocation" => "urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd" ) {
xml.command {
xml.check {
xml.check("xmlns:domain" => "http://www.nominet.org.uk/epp/xml/nom-domain-2.0",
"xsi:schemaLocation" => "http://www.nominet.org.uk/epp/xml/nom-domain-2.0 nom-domain-2.0.xsd") {
xml.parent.namespace = xml.parent.namespace_definitions.first
domains.each {|d|
xml["domain"].name d
}
}
}
}
}
end
r = self.write( builder.to_xml )
r.response.resdata.chkdata.domain_names.inject({}){|hash,domain|
hash.merge( domain => r.response.resdata.chkdata.domain_names_avail.shift == "1")
}
end
|