epp-nokogiri 1.0.1 → 1.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71d59991d2919cdb4aad9190b0bc63180131a360
4
- data.tar.gz: 3c7a053f95d318c44b9b3fa318504e023d935418
3
+ metadata.gz: e6e7fa3bf419c26b5dfe8c73e2ca66eb6942e9ea
4
+ data.tar.gz: 21a0b82439f9698eb7756135ca2c9de2af2f7a9e
5
5
  SHA512:
6
- metadata.gz: f724761625a2ad59796c0ff40b1f6dff946db06474766026e1a0ffa3b0b93f425bb07cb8ab121d0ea395f32a6002d176b4f44f7966c96c4462fd45c5de465707
7
- data.tar.gz: 26afc81dd24651048e21d45c7e3fadbf8a6c88d326c0467f3751834435e7605f0408ae5dd46f9cdd2f2e7b54e37bbd495120a10beb44316ab3265e5553f1e51e
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 = ["Josh Delsman", "Delwyn de Villiers", "Priit Haamer"]
9
- s.email = ["jdelsman@ultraspeed.com", "delwyn.d@gmail.com", "priit@edicy.com"]
10
- s.homepage = "https://github.com/priithaamer/epp"
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' => 'urn:ietf:params:xml:ns:epp-1.0',
43
- 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
44
- 'xsi:schemaLocation' => 'urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd'
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
- xml.objURI "urn:ietf:params:xml:ns:domain-1.0"
158
- xml.objURI "urn:ietf:params:xml:ns:contact-1.0"
159
- xml.objURI "urn:ietf:params:xml:ns:host-1.0"
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 = doc.css('epp response result msg').first.text.strip
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
@@ -1,3 +1,3 @@
1
1
  module Epp
2
- VERSION = "1.0.1"
2
+ VERSION = '1.1.0'
3
3
  end
data/test/test_epp.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class EppTest < Test::Unit::TestCase
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
- assert_nothing_raised do
35
- epp = Epp::Server.new(:server => "a", :tag => "a", :password => "a")
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
- assert_nothing_raised do
199
- e = EppErrorResponse.new(:xml => "a", :code => "a", :message => "a")
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 'test/unit'
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::Unit::TestCase
12
+ class Minitest::Test
12
13
  end
@@ -1,2 +1,2 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <epp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:ietf:params:xml:ns:epp-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd"/>
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.1
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: 2015-12-01 00:00:00.000000000 Z
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/priithaamer/epp
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.2.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