epp-client-hostmaster 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,5 +3,17 @@ module EPPClient
|
|
3
3
|
def hello
|
4
4
|
send_request(builder {|xml| xml.hello})
|
5
5
|
end
|
6
|
+
|
7
|
+
def recv_frame_to_xml
|
8
|
+
recv_xml = super
|
9
|
+
log.write recv_xml.to_s.gsub(/^/, '>> ') if log
|
10
|
+
recv_xml
|
11
|
+
end
|
12
|
+
|
13
|
+
def sent_frame_to_xml
|
14
|
+
send_xml = super
|
15
|
+
log.write send_xml.to_s.gsub(/^/, '>> ') if log
|
16
|
+
send_xml
|
17
|
+
end
|
6
18
|
end
|
7
19
|
end
|
@@ -32,11 +32,22 @@ module EPPClient
|
|
32
32
|
unless attrs.key?(:client_id) && attrs.key?(:password) && attrs.key?(:ssl_cert) && attrs.key?(:ssl_key)
|
33
33
|
raise ArgumentError, "client_id, password, ssl_cert and ssl_key are required"
|
34
34
|
end
|
35
|
+
if attrs.key?(:log_path)
|
36
|
+
@log_path = attrs[:log_path]
|
37
|
+
attrs.delete :log_path
|
38
|
+
end
|
35
39
|
attrs[:server] ||= 'epp.hostmaster.ua'
|
36
40
|
attrs[:port] ||= 700
|
37
41
|
attrs[:version] ||= '1.0'
|
38
42
|
@services = EPPClient::SCHEMAS_URL.values_at('domain', 'host', 'contact')
|
39
43
|
super(attrs)
|
40
44
|
end
|
45
|
+
|
46
|
+
def log
|
47
|
+
if @log.nil? && !@log_path.nil?
|
48
|
+
@log = File.open("#@log_path/#{Time.now.to_i}.log", "w")
|
49
|
+
end
|
50
|
+
@log
|
51
|
+
end
|
41
52
|
end
|
42
53
|
end
|