epp-nokogiri 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/epp.gemspec +4 -3
- data/lib/epp/server.rb +16 -8
- data/lib/epp/version.rb +1 -1
- data/test/test_epp.rb +5 -7
- data/test/test_helper.rb +4 -3
- data/test/xml/new_request.xml +1 -1
- metadata +20 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6e7fa3bf419c26b5dfe8c73e2ca66eb6942e9ea
|
4
|
+
data.tar.gz: 21a0b82439f9698eb7756135ca2c9de2af2f7a9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94f98ba053dcff2948f243ac1f69ed483622be3603ffd14962099b2d7322077f37836b7cd0d3ca80c40b8d1b55ff6db33d60c44439bd271cc93b24ff7e853c77
|
7
|
+
data.tar.gz: 9ff30e2a6a30c84d488855c37e1149237c8bbd339c642a4a95fb45ab9e33255d1f87a12a0862a56de63208e46fda58782342e81a922c50e5aae15ec480b1f21a
|
data/epp.gemspec
CHANGED
@@ -5,9 +5,9 @@ require "epp/version"
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "epp-nokogiri"
|
7
7
|
s.version = Epp::VERSION
|
8
|
-
s.authors = [
|
9
|
-
s.email = [
|
10
|
-
s.homepage = "https://github.com/
|
8
|
+
s.authors = ['Josh Delsman', 'Delwyn de Villiers', 'Priit Haamer', 'Tanel Jakobsoo']
|
9
|
+
s.email = ['jdelsman@ultraspeed.com', 'delwyn.d@gmail.com', 'priit@edicy.com', 'tanel@voog.com']
|
10
|
+
s.homepage = "https://github.com/Voog/epp"
|
11
11
|
s.summary = %q{EPP (Extensible Provisioning Protocol) for Ruby}
|
12
12
|
s.description = %q{Basic functionality for connecting and making requests on EPP (Extensible Provisioning Protocol) servers}
|
13
13
|
s.license = 'MIT'
|
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_runtime_dependency("uuidtools", [">= 0"])
|
24
24
|
|
25
25
|
s.add_development_dependency("shoulda", [">= 0"])
|
26
|
+
s.add_development_dependency("minitest", [">= 0"])
|
26
27
|
s.add_development_dependency("mocha", [">= 0"])
|
27
28
|
s.add_development_dependency("rake", [">= 0"])
|
28
29
|
end
|
data/lib/epp/server.rb
CHANGED
@@ -2,7 +2,7 @@ module Epp #:nodoc:
|
|
2
2
|
class Server
|
3
3
|
include RequiresParameters
|
4
4
|
|
5
|
-
attr_accessor :tag, :password, :server, :port, :lang, :services, :extensions, :version, :key, :cert
|
5
|
+
attr_accessor :tag, :password, :server, :port, :xmlns, :xmlns_xsi, :xsi_schema_location, :lang, :services, :extensions, :version, :key, :cert
|
6
6
|
|
7
7
|
# ==== Required Attrbiutes
|
8
8
|
#
|
@@ -13,6 +13,9 @@ module Epp #:nodoc:
|
|
13
13
|
# ==== Optional Attributes
|
14
14
|
#
|
15
15
|
# * <tt>:port</tt> - The EPP standard port is 700. However, you can choose a different port to use.
|
16
|
+
# * <tt>:xmlns</tt> - The EPP xmlns value. Default is 'urn:ietf:params:xml:ns:epp-1.0'.
|
17
|
+
# * <tt>:xmlns_xsi</tt> - The EPP xmlns:xsi value. Default is 'http://www.w3.org/2001/XMLSchema-instance'.
|
18
|
+
# * <tt>:xsi_schema_location</tt> - The EPP xsi:schemaLocation value. Default is 'urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd'.
|
16
19
|
# * <tt>:lang</tt> - Set custom language attribute. Default is 'en'.
|
17
20
|
# * <tt>:services</tt> - Use custom EPP services in the <login> frame. The defaults use the EPP standard domain, contact and host 1.0 services.
|
18
21
|
# * <tt>:extensions</tt> - URLs to custom extensions to standard EPP. Use these to extend the standard EPP (e.g., Nominet uses extensions). Defaults to none.
|
@@ -26,6 +29,9 @@ module Epp #:nodoc:
|
|
26
29
|
@password = attributes[:password]
|
27
30
|
@server = attributes[:server]
|
28
31
|
@port = attributes[:port] || 700
|
32
|
+
@xmlns = attributes[:xmlns] || 'urn:ietf:params:xml:ns:epp-1.0'
|
33
|
+
@xmlns_xsi = attributes[:xmlns_xsi] || 'http://www.w3.org/2001/XMLSchema-instance'
|
34
|
+
@xsi_schema_location = attributes[:xsi_schema_location] || 'urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd'
|
29
35
|
@lang = attributes[:lang] || "en"
|
30
36
|
@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"]
|
31
37
|
@extensions = attributes[:extensions] || []
|
@@ -39,9 +45,9 @@ module Epp #:nodoc:
|
|
39
45
|
def build_epp_request(&block)
|
40
46
|
builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
|
41
47
|
xml.epp(
|
42
|
-
'xmlns' =>
|
43
|
-
'xmlns:xsi' =>
|
44
|
-
'xsi:schemaLocation' =>
|
48
|
+
'xmlns' => xmlns,
|
49
|
+
'xmlns:xsi' => xmlns_xsi,
|
50
|
+
'xsi:schemaLocation' => xsi_schema_location
|
45
51
|
) do
|
46
52
|
yield xml if block_given?
|
47
53
|
end
|
@@ -154,9 +160,11 @@ module Epp #:nodoc:
|
|
154
160
|
xml.lang lang
|
155
161
|
}
|
156
162
|
xml.svcs {
|
157
|
-
|
158
|
-
|
159
|
-
|
163
|
+
unless services.empty?
|
164
|
+
services.each do |uri|
|
165
|
+
xml.objURI uri
|
166
|
+
end
|
167
|
+
end
|
160
168
|
|
161
169
|
unless extensions.empty?
|
162
170
|
xml.svcExtension {
|
@@ -198,7 +206,7 @@ module Epp #:nodoc:
|
|
198
206
|
if result_code == acceptable_response
|
199
207
|
return true
|
200
208
|
else
|
201
|
-
result_message =
|
209
|
+
result_message = response.css('epp response result msg').first.text.strip
|
202
210
|
|
203
211
|
raise EppErrorResponse.new(:xml => response, :code => result_code, :message => result_message)
|
204
212
|
end
|
data/lib/epp/version.rb
CHANGED
data/test/test_epp.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class EppTest < Test
|
3
|
+
class EppTest < Minitest::Test
|
4
4
|
context "EPP" do
|
5
5
|
context "server" do
|
6
6
|
setup do
|
@@ -31,9 +31,8 @@ class EppTest < Test::Unit::TestCase
|
|
31
31
|
epp = Epp::Server.new(:server => "a", :tag => "a")
|
32
32
|
end
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
end
|
34
|
+
# Assert nothing raised
|
35
|
+
assert Epp::Server.new(:server => "a", :tag => "a", :password => "a")
|
37
36
|
end
|
38
37
|
|
39
38
|
should "set instance variables for attributes" do
|
@@ -195,9 +194,8 @@ class EppTest < Test::Unit::TestCase
|
|
195
194
|
e = EppErrorResponse.new(:xml => "a", :code => "a")
|
196
195
|
end
|
197
196
|
|
198
|
-
|
199
|
-
|
200
|
-
end
|
197
|
+
# Assert nothing raised
|
198
|
+
assert EppErrorResponse.new(:xml => "a", :code => "a", :message => "a")
|
201
199
|
end
|
202
200
|
|
203
201
|
should "print error message to string" do
|
data/test/test_helper.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require '
|
2
|
+
require 'minitest/autorun'
|
3
|
+
# require 'test/unit'
|
3
4
|
require 'shoulda'
|
4
|
-
require 'mocha'
|
5
|
+
require 'mocha/setup'
|
5
6
|
|
6
7
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
7
8
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
8
9
|
|
9
10
|
require 'epp'
|
10
11
|
|
11
|
-
class Test
|
12
|
+
class Minitest::Test
|
12
13
|
end
|
data/test/xml/new_request.xml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<epp xmlns
|
2
|
+
<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"/>
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epp-nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Delsman
|
8
8
|
- Delwyn de Villiers
|
9
9
|
- Priit Haamer
|
10
|
+
- Tanel Jakobsoo
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date:
|
14
|
+
date: 2017-01-03 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: nokogiri
|
@@ -54,6 +55,20 @@ dependencies:
|
|
54
55
|
- - ">="
|
55
56
|
- !ruby/object:Gem::Version
|
56
57
|
version: '0'
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: minitest
|
60
|
+
requirement: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
type: :development
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
57
72
|
- !ruby/object:Gem::Dependency
|
58
73
|
name: mocha
|
59
74
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,6 +103,7 @@ email:
|
|
88
103
|
- jdelsman@ultraspeed.com
|
89
104
|
- delwyn.d@gmail.com
|
90
105
|
- priit@edicy.com
|
106
|
+
- tanel@voog.com
|
91
107
|
executables: []
|
92
108
|
extensions: []
|
93
109
|
extra_rdoc_files: []
|
@@ -116,7 +132,7 @@ files:
|
|
116
132
|
- test/xml/socket_preparation.xml
|
117
133
|
- test/xml/test_request.xml
|
118
134
|
- test/xml/test_response.xml
|
119
|
-
homepage: https://github.com/
|
135
|
+
homepage: https://github.com/Voog/epp
|
120
136
|
licenses:
|
121
137
|
- MIT
|
122
138
|
metadata: {}
|
@@ -136,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
152
|
version: '0'
|
137
153
|
requirements: []
|
138
154
|
rubyforge_project: epp
|
139
|
-
rubygems_version: 2.
|
155
|
+
rubygems_version: 2.4.8
|
140
156
|
signing_key:
|
141
157
|
specification_version: 4
|
142
158
|
summary: EPP (Extensible Provisioning Protocol) for Ruby
|