epp 1.2.1 → 1.2.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.
- data/VERSION +1 -1
- data/epp.gemspec +61 -0
- data/lib/epp/server.rb +18 -2
- metadata +42 -17
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.2
|
data/epp.gemspec
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{epp}
|
8
|
+
s.version = "1.2.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Josh Delsman"]
|
12
|
+
s.date = %q{2010-07-01}
|
13
|
+
s.description = %q{Basic functionality for connecting and making requests on EPP (Extensible Provisioning Protocol) servers}
|
14
|
+
s.email = %q{jdelsman@ultraspeed.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
"LICENSE",
|
21
|
+
"README.rdoc",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION",
|
24
|
+
"epp.gemspec",
|
25
|
+
"lib/epp.rb",
|
26
|
+
"lib/epp/exceptions.rb",
|
27
|
+
"lib/epp/server.rb",
|
28
|
+
"lib/require_parameters.rb",
|
29
|
+
"test/epp_test.rb",
|
30
|
+
"test/test_helper.rb"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/ultraspeed/epp}
|
33
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.3.7}
|
36
|
+
s.summary = %q{EPP (Extensible Provisioning Protocol) for Ruby}
|
37
|
+
s.test_files = [
|
38
|
+
"test/epp_test.rb",
|
39
|
+
"test/test_helper.rb"
|
40
|
+
]
|
41
|
+
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
48
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
49
|
+
s.add_runtime_dependency(%q<hpricot>, [">= 0"])
|
50
|
+
else
|
51
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
52
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
53
|
+
s.add_dependency(%q<hpricot>, [">= 0"])
|
54
|
+
end
|
55
|
+
else
|
56
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
57
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
58
|
+
s.add_dependency(%q<hpricot>, [">= 0"])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
data/lib/epp/server.rb
CHANGED
@@ -32,6 +32,7 @@ module Epp #:nodoc:
|
|
32
32
|
@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"]
|
33
33
|
@extensions = attributes[:extensions] || []
|
34
34
|
@version = attributes[:verison] || "1.0"
|
35
|
+
@debug_log = attributes[:debug_log] || false
|
35
36
|
|
36
37
|
@logged_in = false
|
37
38
|
end
|
@@ -46,6 +47,7 @@ module Epp #:nodoc:
|
|
46
47
|
@logged_in = true if login
|
47
48
|
|
48
49
|
begin
|
50
|
+
puts "** EPP - Sending frame..." if @debug_log
|
49
51
|
@response = send_request(xml)
|
50
52
|
ensure
|
51
53
|
if @logged_in && !old_server
|
@@ -62,6 +64,8 @@ module Epp #:nodoc:
|
|
62
64
|
|
63
65
|
# Sends a standard login request to the EPP server.
|
64
66
|
def login
|
67
|
+
puts "** EPP - Attempting login..." if @debug_log
|
68
|
+
|
65
69
|
xml = new_epp_request
|
66
70
|
|
67
71
|
command = xml.root.add_element("command")
|
@@ -95,6 +99,7 @@ module Epp #:nodoc:
|
|
95
99
|
result_code = (response/"epp"/"response"/"result").attr("code").to_i
|
96
100
|
|
97
101
|
if result_code == 1000
|
102
|
+
puts "** EPP - Successfully logged in." if @debug_log
|
98
103
|
return true
|
99
104
|
else
|
100
105
|
raise EppErrorResponse.new(:xml => response, :code => result_code, :message => result_message)
|
@@ -103,6 +108,8 @@ module Epp #:nodoc:
|
|
103
108
|
|
104
109
|
# Sends a standard logout request to the EPP server.
|
105
110
|
def logout
|
111
|
+
puts "** EPP - Attempting logout..." if @debug_log
|
112
|
+
|
106
113
|
xml = new_epp_request
|
107
114
|
|
108
115
|
command = xml.root.add_element("command")
|
@@ -115,6 +122,7 @@ module Epp #:nodoc:
|
|
115
122
|
result_code = (response/"epp"/"response"/"result").attr("code").to_i
|
116
123
|
|
117
124
|
if result_code == 1500
|
125
|
+
puts "** EPP - Successfully logged out." if @debug_log
|
118
126
|
return true
|
119
127
|
else
|
120
128
|
raise EppErrorResponse.new(:xml => response, :code => result_code, :message => result_message)
|
@@ -156,7 +164,12 @@ module Epp #:nodoc:
|
|
156
164
|
@socket.connect
|
157
165
|
|
158
166
|
# Get the initial frame
|
159
|
-
get_frame
|
167
|
+
frame = get_frame
|
168
|
+
|
169
|
+
if frame
|
170
|
+
puts "EPP - Connection opened." if @debug_log
|
171
|
+
return frame
|
172
|
+
end
|
160
173
|
end
|
161
174
|
|
162
175
|
# Closes the connection to the EPP server.
|
@@ -171,7 +184,10 @@ module Epp #:nodoc:
|
|
171
184
|
@connection = nil
|
172
185
|
end
|
173
186
|
|
174
|
-
|
187
|
+
if @connection.nil? and @socket.nil?
|
188
|
+
puts "EPP - Connection closed." if @debug_log
|
189
|
+
return true
|
190
|
+
end
|
175
191
|
end
|
176
192
|
|
177
193
|
# Receive an EPP frame from the server. Since the connection is blocking,
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 2
|
9
|
+
- 2
|
10
|
+
version: 1.2.2
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Josh Delsman
|
@@ -9,39 +15,51 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-07-01 00:00:00 -04:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: shoulda
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
23
32
|
version: "0"
|
24
|
-
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
25
35
|
- !ruby/object:Gem::Dependency
|
26
36
|
name: activesupport
|
27
|
-
|
28
|
-
|
29
|
-
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
30
40
|
requirements:
|
31
41
|
- - ">="
|
32
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
33
46
|
version: "0"
|
34
|
-
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
35
49
|
- !ruby/object:Gem::Dependency
|
36
50
|
name: hpricot
|
37
|
-
|
38
|
-
|
39
|
-
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
40
54
|
requirements:
|
41
55
|
- - ">="
|
42
56
|
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
43
60
|
version: "0"
|
44
|
-
|
61
|
+
type: :runtime
|
62
|
+
version_requirements: *id003
|
45
63
|
description: Basic functionality for connecting and making requests on EPP (Extensible Provisioning Protocol) servers
|
46
64
|
email: jdelsman@ultraspeed.com
|
47
65
|
executables: []
|
@@ -56,6 +74,7 @@ files:
|
|
56
74
|
- README.rdoc
|
57
75
|
- Rakefile
|
58
76
|
- VERSION
|
77
|
+
- epp.gemspec
|
59
78
|
- lib/epp.rb
|
60
79
|
- lib/epp/exceptions.rb
|
61
80
|
- lib/epp/server.rb
|
@@ -72,21 +91,27 @@ rdoc_options:
|
|
72
91
|
require_paths:
|
73
92
|
- lib
|
74
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
75
95
|
requirements:
|
76
96
|
- - ">="
|
77
97
|
- !ruby/object:Gem::Version
|
98
|
+
hash: 3
|
99
|
+
segments:
|
100
|
+
- 0
|
78
101
|
version: "0"
|
79
|
-
version:
|
80
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
81
104
|
requirements:
|
82
105
|
- - ">="
|
83
106
|
- !ruby/object:Gem::Version
|
107
|
+
hash: 3
|
108
|
+
segments:
|
109
|
+
- 0
|
84
110
|
version: "0"
|
85
|
-
version:
|
86
111
|
requirements: []
|
87
112
|
|
88
113
|
rubyforge_project:
|
89
|
-
rubygems_version: 1.3.
|
114
|
+
rubygems_version: 1.3.7
|
90
115
|
signing_key:
|
91
116
|
specification_version: 3
|
92
117
|
summary: EPP (Extensible Provisioning Protocol) for Ruby
|