epp 1.1.1 → 1.1.2

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/epp/server.rb +18 -2
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
data/lib/epp/server.rb CHANGED
@@ -31,6 +31,7 @@ module Epp #:nodoc:
31
31
  @services = attributes[:services] || ["urn:ietf:params:xml:ns:domain-1.0", "urn:ietf:params:xml:ns:contact-1.0", "urn:ietf:params:xml:ns:host-1.0"]
32
32
  @extensions = attributes[:extensions] || []
33
33
  @version = attributes[:verison] || "1.0"
34
+ @debug_log = attributes[:debug_log] || false
34
35
 
35
36
  @logged_in = false
36
37
  end
@@ -45,6 +46,7 @@ module Epp #:nodoc:
45
46
  @logged_in = true if login
46
47
 
47
48
  begin
49
+ puts "** EPP - Sending frame..." if @debug_log
48
50
  @response = send_request(xml)
49
51
  ensure
50
52
  if @logged_in && !@old_server
@@ -61,6 +63,8 @@ module Epp #:nodoc:
61
63
 
62
64
  # Sends a standard login request to the EPP server.
63
65
  def login
66
+ puts "** EPP - Attempting login..." if @debug_log
67
+
64
68
  xml = new_epp_request
65
69
 
66
70
  command = xml.root.add_element("command")
@@ -94,6 +98,7 @@ module Epp #:nodoc:
94
98
  result_code = (response/"epp"/"response"/"result").attr("code").to_i
95
99
 
96
100
  if result_code == 1000
101
+ puts "** EPP - Successfully logged in." if @debug_log
97
102
  return true
98
103
  else
99
104
  raise EppErrorResponse.new(:xml => response, :code => result_code, :message => result_message)
@@ -102,6 +107,8 @@ module Epp #:nodoc:
102
107
 
103
108
  # Sends a standard logout request to the EPP server.
104
109
  def logout
110
+ puts "** EPP - Attempting logout..." if @debug_log
111
+
105
112
  xml = new_epp_request
106
113
 
107
114
  command = xml.root.add_element("command")
@@ -114,6 +121,7 @@ module Epp #:nodoc:
114
121
  result_code = (response/"epp"/"response"/"result").attr("code").to_i
115
122
 
116
123
  if result_code == 1500
124
+ puts "** EPP - Successfully logged out." if @debug_log
117
125
  return true
118
126
  else
119
127
  raise EppErrorResponse.new(:xml => response, :code => result_code, :message => result_message)
@@ -155,7 +163,12 @@ module Epp #:nodoc:
155
163
  @socket.connect
156
164
 
157
165
  # Get the initial frame
158
- get_frame
166
+ frame = get_frame
167
+
168
+ if frame
169
+ puts "EPP - Connection opened." if @debug_log
170
+ return frame
171
+ end
159
172
  end
160
173
 
161
174
  # Closes the connection to the EPP server.
@@ -170,7 +183,10 @@ module Epp #:nodoc:
170
183
  @connection = nil
171
184
  end
172
185
 
173
- return true if @connection.nil? and @socket.nil?
186
+ if @connection.nil? and @socket.nil?
187
+ puts "EPP - Connection closed." if @debug_log
188
+ return true
189
+ end
174
190
  end
175
191
 
176
192
  # Receive an EPP frame from the server. Since the connection is blocking,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Delsman
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-19 00:00:00 +01:00
12
+ date: 2010-01-15 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency