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.
@@ -6,5 +6,10 @@ module EPPClient
6
6
  @socket.write xml
7
7
  sent_frame_to_xml
8
8
  end
9
+
10
+ def close_connection
11
+ log.close unless log.nil?
12
+ super
13
+ end
9
14
  end
10
15
  end
@@ -1,5 +1,5 @@
1
1
  module EPPClient
2
2
  module HostmasterVersion
3
- VERSION = '0.2.7'
3
+ VERSION = '0.2.8'
4
4
  end
5
5
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epp-client-hostmaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: