epp-client-smallregistry 0.14.0 → 0.15.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
- data.tar.gz: 9816c9c05828c27e998b2b8afa1861f52959cecf
4
- metadata.gz: 36c3fc96562ff7ce617776512edbed15dd3d613e
3
+ metadata.gz: 9ce55839344414492ea52c18a156de42b11aeb72
4
+ data.tar.gz: 17511216caf0433573bd3e6943b55c07c4975b64
5
5
  SHA512:
6
- data.tar.gz: 7fbd62cb334c36b9f62152506349ba376233ac197a5b9a403db36293f80ec8be947e96fe19954303d5551e0086488e1da8f2c8214272775914dda6f0ae8eeebd
7
- metadata.gz: 229f017d8dfad9142d37a93f6c6bffbc9ce62d92663ca37746ddf1fa25b2fac96d95d82adccc1cd65ed5b1e55a47dbeb8878c8a7e921f6758df5eeedd7abed03
6
+ metadata.gz: fdf3af5bd4ab31b42768b41099f0cff5537a94a44affda477d976527c6114f1dfbc91c17b560a11860c9aa6f04c73380523d4114abfa3ffbddf13e2941401ca7
7
+ data.tar.gz: 2fe2395652253fa87170e4ff2c00013758d3f0c4e6001ffc0087aa364d2adb6d8ea85a7a59b8e5fbbf718a7864dbd76ef89b8b4cbb563bf952dc0b06697f5c83
data/Rakefile CHANGED
@@ -2,9 +2,9 @@
2
2
  require 'rake'
3
3
  require 'rdoc/task'
4
4
  require 'rubygems/package_task'
5
- require "bundler/gem_helper"
5
+ require 'bundler/gem_helper'
6
6
 
7
- MY_GEMS = Dir['*.gemspec'].map {|g| g.sub(/.*-(.*)\.gemspec/, '\1')}
7
+ MY_GEMS = Dir['*.gemspec'].map { |g| g.sub(/.*-(.*)\.gemspec/, '\1') }
8
8
 
9
9
  MY_GEMS.each do |g|
10
10
  namespace g do
@@ -26,10 +26,10 @@ task :build => 'all:build'
26
26
  task :install => 'all:install'
27
27
  task :push => 'all:push'
28
28
 
29
- desc "Generate documentation for the Rails framework"
29
+ desc 'Generate documentation for the Rails framework'
30
30
  Rake::RDocTask.new do |rdoc|
31
31
  rdoc.rdoc_dir = 'doc/rdoc'
32
- rdoc.title = "Documentation"
32
+ rdoc.title = 'Documentation'
33
33
 
34
34
  rdoc.options << '--line-numbers' << '--inline-source'
35
35
  rdoc.options << '--charset' << 'utf-8'
@@ -38,4 +38,3 @@ Rake::RDocTask.new do |rdoc|
38
38
  rdoc.rdoc_files.include('ChangeLog')
39
39
  rdoc.rdoc_files.include('lib/**/*.rb')
40
40
  end
41
-
@@ -8,12 +8,12 @@ Gem::Specification.new do |gem|
8
8
  gem.email = ['m@absolight.fr']
9
9
  gem.description = 'Smallregistry EPP client library.'
10
10
  gem.summary = 'Smallregistry EPP client library'
11
- gem.homepage = "https://github.com/Absolight/epp-client"
11
+ gem.homepage = 'https://github.com/Absolight/epp-client'
12
12
 
13
13
  gem.required_ruby_version = '>= 1.8.7'
14
- gem.required_rubygems_version = ">= 1.3.6"
14
+ gem.required_rubygems_version = '>= 1.3.6'
15
15
 
16
- gem.files = [
16
+ gem.files = [
17
17
  'ChangeLog',
18
18
  'EXAMPLE.SMALLREGISTRY',
19
19
  'Gemfile',
@@ -28,9 +28,9 @@ Gem::Specification.new do |gem|
28
28
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
29
29
  gem.require_paths = ['lib']
30
30
 
31
- gem.add_development_dependency "bundler", ">= 1.0.0"
31
+ gem.add_development_dependency 'bundler', '>= 1.0.0'
32
32
  gem.add_dependency('nokogiri', '~> 1.4')
33
33
  gem.add_dependency('builder', '>= 2.1.2')
34
- gem.add_dependency('epp-client-base', "#{EPPClient::VERSION}")
35
- gem.add_dependency('epp-client-secdns', "#{EPPClient::VERSION}")
34
+ gem.add_dependency('epp-client-base', EPPClient::VERSION.to_s)
35
+ gem.add_dependency('epp-client-secdns', EPPClient::VERSION.to_s)
36
36
  end
@@ -2,13 +2,16 @@ require 'epp-client/base'
2
2
  require 'epp-client/secdns'
3
3
 
4
4
  module EPPClient
5
+ # This handles the Smallregistry specificites.
6
+ #
7
+ # See
8
+ # https://www.smallregistry.net/faqs/quelles-sont-les-specificites-du-serveur-epp
5
9
  class SmallRegistry < Base
6
-
7
- SCHEMAS_SR = %w[
10
+ SCHEMAS_SR = %w(
8
11
  sr-1.0
9
- ]
12
+ ).freeze
10
13
 
11
- EPPClient::SCHEMAS_URL.merge!(SCHEMAS_SR.inject({}) do |a,s|
14
+ EPPClient::SCHEMAS_URL.merge!(SCHEMAS_SR.inject({}) do |a, s|
12
15
  a[s.sub(/-1\.0$/, '')] = "https://www.smallregistry.net/schemas/#{s}.xsd" if s =~ /-1\.0$/
13
16
  a[s] = "https://www.smallregistry.net/schemas/#{s}.xsd"
14
17
  a
@@ -32,14 +35,14 @@ module EPPClient
32
35
  # See EPPClient for other attributes.
33
36
  def initialize(attrs)
34
37
  unless attrs.key?(:client_id) && attrs.key?(:password) && attrs.key?(:ssl_cert) && attrs.key?(:ssl_key)
35
- raise ArgumentError, "client_id, password, ssl_cert and ssl_key are required"
38
+ fail ArgumentError, 'client_id, password, ssl_cert and ssl_key are required'
36
39
  end
37
40
  if attrs.delete(:test) == true
38
- attrs[:server] ||= 'epp.test.smallregistry.net'
39
- attrs[:port] ||= 2700
41
+ attrs[:server] ||= 'epp.test.smallregistry.net'
42
+ attrs[:port] ||= 2700
40
43
  else
41
- attrs[:server] ||= 'epp.smallregistry.net'
42
- attrs[:port] ||= 700
44
+ attrs[:server] ||= 'epp.smallregistry.net'
45
+ attrs[:port] ||= 700
43
46
  end
44
47
  @services = EPPClient::SCHEMAS_URL.values_at('domain', 'contact')
45
48
  super(attrs)
@@ -68,15 +71,15 @@ module EPPClient
68
71
  def contact_info_process(xml) #:nodoc:
69
72
  ret = super
70
73
  if (contact = xml.xpath('epp:extension/sr:ext/sr:infData/sr:contact', EPPClient::SCHEMAS_URL)).size > 0
71
- if (person = contact.xpath('sr:person', EPPClient::SCHEMAS_URL)).size > 0
72
- ret[:person] = {
73
- :birthDate => Date.parse(person.xpath('sr:birthDate', EPPClient::SCHEMAS_URL).text),
74
- :birthPlace => person.xpath('sr:birthPlace', EPPClient::SCHEMAS_URL).text,
75
- }
76
- end
77
- if (org = contact.xpath('sr:org', EPPClient::SCHEMAS_URL)).size > 0
78
- ret[:org] = { :companySerial => org.xpath('sr:companySerial', EPPClient::SCHEMAS_URL).text }
79
- end
74
+ if (person = contact.xpath('sr:person', EPPClient::SCHEMAS_URL)).size > 0
75
+ ret[:person] = {
76
+ :birthDate => Date.parse(person.xpath('sr:birthDate', EPPClient::SCHEMAS_URL).text),
77
+ :birthPlace => person.xpath('sr:birthPlace', EPPClient::SCHEMAS_URL).text,
78
+ }
79
+ end
80
+ if (org = contact.xpath('sr:org', EPPClient::SCHEMAS_URL)).size > 0
81
+ ret[:org] = { :companySerial => org.xpath('sr:companySerial', EPPClient::SCHEMAS_URL).text }
82
+ end
80
83
  end
81
84
  ret
82
85
  end
@@ -103,22 +106,22 @@ module EPPClient
103
106
  ret = super
104
107
 
105
108
  ext = extension do |xml|
106
- xml.ext( :xmlns => EPPClient::SCHEMAS_URL['sr']) do
107
- xml.create do
108
- xml.contact do
109
- if contact.key?(:org)
110
- xml.org do
111
- xml.companySerial(contact[:org][:companySerial])
112
- end
113
- elsif contact.key?(:person)
114
- xml.person do
115
- xml.birthDate(contact[:person][:birthDate])
116
- xml.birthPlace(contact[:person][:birthPlace])
117
- end
118
- end
119
- end
120
- end
121
- end
109
+ xml.ext(:xmlns => EPPClient::SCHEMAS_URL['sr']) do
110
+ xml.create do
111
+ xml.contact do
112
+ if contact.key?(:org)
113
+ xml.org do
114
+ xml.companySerial(contact[:org][:companySerial])
115
+ end
116
+ elsif contact.key?(:person)
117
+ xml.person do
118
+ xml.birthDate(contact[:person][:birthDate])
119
+ xml.birthPlace(contact[:person][:birthPlace])
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
122
125
  end
123
126
 
124
127
  insert_extension(ret, ext)
@@ -127,30 +130,28 @@ module EPPClient
127
130
  def contact_update_xml(args) #:nodoc:
128
131
  ret = super
129
132
 
130
- if args.key?(:chg) && (args[:chg].key?(:org) || args[:chg].key?(:person))
131
- ext = extension do |xml|
132
- xml.ext( :xmlns => EPPClient::SCHEMAS_URL['sr']) do
133
- xml.update do
134
- xml.contact do
135
- if args[:chg].key?(:org)
136
- xml.org do
137
- xml.companySerial(args[:chg][:org][:companySerial])
138
- end
139
- elsif args[:chg].key?(:person)
140
- xml.person do
141
- xml.birthDate(args[:chg][:person][:birthDate])
142
- xml.birthPlace(args[:chg][:person][:birthPlace])
143
- end
144
- end
145
- end
146
- end
147
- end
148
- end
133
+ return ret unless args.key?(:chg) && (args[:chg].key?(:org) || args[:chg].key?(:person))
149
134
 
150
- return insert_extension(ret, ext)
151
- else
152
- return ret
135
+ ext = extension do |xml|
136
+ xml.ext(:xmlns => EPPClient::SCHEMAS_URL['sr']) do
137
+ xml.update do
138
+ xml.contact do
139
+ if args[:chg].key?(:org)
140
+ xml.org do
141
+ xml.companySerial(args[:chg][:org][:companySerial])
142
+ end
143
+ elsif args[:chg].key?(:person)
144
+ xml.person do
145
+ xml.birthDate(args[:chg][:person][:birthDate])
146
+ xml.birthPlace(args[:chg][:person][:birthPlace])
147
+ end
148
+ end
149
+ end
150
+ end
151
+ end
153
152
  end
153
+
154
+ insert_extension(ret, ext)
154
155
  end
155
156
 
156
157
  # Extends the EPPClient::Contact#contact_update so that the specific afnic
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epp-client-smallregistry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathieu Arnold
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2016-02-10 00:00:00 Z
12
+ date: 2016-02-17 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -48,7 +48,7 @@ dependencies:
48
48
  requirements:
49
49
  - - "="
50
50
  - !ruby/object:Gem::Version
51
- version: 0.14.0
51
+ version: 0.15.0
52
52
  type: :runtime
53
53
  version_requirements: *id004
54
54
  - !ruby/object:Gem::Dependency
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - "="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.14.0
61
+ version: 0.15.0
62
62
  type: :runtime
63
63
  version_requirements: *id005
64
64
  description: Smallregistry EPP client library.