epp-client-afnic 0.15.0 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -7
  2. data/lib/epp-client/afnic.rb +28 -28
  3. metadata +84 -69
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA512:
3
- metadata.gz: 46632d82cdedaa8f5741f2188aaa8f59e9c77d6e31179997253cac9c773cf58926e1f431a07eb0da9cb1ad86ea70246dfedc9df5050cf69530f4ea80a553a65d
4
- data.tar.gz: c2abc4895ec08a6ce2706f409c964224927079e3ddace1197643d3d6a11c9c96487d132958018b316e5421a62c451911b93b3d8df21f4fc4e1fcf037e5885b98
5
- SHA1:
6
- metadata.gz: 8f2c6f33f1787eeb6d0fe4acf073ffbd46100269
7
- data.tar.gz: 3ded489d87400522ec64bc8deea3ab4ed0c4122c
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6994c89be5a2f16c69a37012066db9345a769494
4
+ data.tar.gz: 00a312742a108d095f5176587e54306edad9b612
5
+ SHA512:
6
+ metadata.gz: 7d565f1e3e3b13711800143d81fbc4ebf4c1f9523089d8163b2eee60c3e3a24bfff2c450560f8a02c58c131dbc12208c0bfea8940a8e55fa4fe3ea8d18264ad1
7
+ data.tar.gz: 64050c3e63d79f1c514b24788fb0b5893aef51d9187c70e7d2d2dcf6b3479874b2d369d13108b9a71604c28bf75f27357657bb452f850daf806882e702a09d20
@@ -71,7 +71,7 @@ module EPPClient
71
71
 
72
72
  def domain_info_process(xml) #:nodoc:
73
73
  ret = super
74
- if (frnic_status = xml.xpath('epp:extension/frnic:ext/frnic:resData/frnic:infData/frnic:domain/frnic:status', EPPClient::SCHEMAS_URL)).size > 0
74
+ unless (frnic_status = xml.xpath('epp:extension/frnic:ext/frnic:resData/frnic:infData/frnic:domain/frnic:status', EPPClient::SCHEMAS_URL)).empty?
75
75
  ret[:status] ||= [] # The status is optional, there may be none at this point.
76
76
  ret[:status] += frnic_status.map { |s| s.attr('s') }
77
77
  end
@@ -82,22 +82,22 @@ module EPPClient
82
82
  def legalEntityInfos(leI) #:nodoc:
83
83
  ret = {}
84
84
  ret[:legalStatus] = leI.xpath('frnic:legalStatus', EPPClient::SCHEMAS_URL).attr('s').value
85
- if (r = leI.xpath('frnic:idStatus', EPPClient::SCHEMAS_URL)).size > 0
85
+ unless (r = leI.xpath('frnic:idStatus', EPPClient::SCHEMAS_URL)).empty?
86
86
  ret[:idStatus] = { :value => r.text }
87
87
  ret[:idStatus][:when] = r.attr('when').value if r.attr('when')
88
88
  ret[:idStatus][:source] = r.attr('source').value if r.attr('source')
89
89
  end
90
90
  %w(siren VAT trademark DUNS local).each do |val|
91
- if (r = leI.xpath("frnic:#{val}", EPPClient::SCHEMAS_URL)).size > 0
91
+ unless (r = leI.xpath("frnic:#{val}", EPPClient::SCHEMAS_URL)).empty?
92
92
  ret[val.to_sym] = r.text
93
93
  end
94
94
  end
95
- if (asso = leI.xpath('frnic:asso', EPPClient::SCHEMAS_URL)).size > 0
95
+ unless (asso = leI.xpath('frnic:asso', EPPClient::SCHEMAS_URL)).empty?
96
96
  ret[:asso] = {}
97
- if (r = asso.xpath('frnic:waldec', EPPClient::SCHEMAS_URL)).size > 0
97
+ if !(r = asso.xpath('frnic:waldec', EPPClient::SCHEMAS_URL)).empty?
98
98
  ret[:asso][:waldec] = r.text
99
99
  else
100
- if (decl = asso.xpath('frnic:decl', EPPClient::SCHEMAS_URL)).size > 0
100
+ unless (decl = asso.xpath('frnic:decl', EPPClient::SCHEMAS_URL)).empty?
101
101
  ret[:asso][:decl] = Date.parse(decl.text)
102
102
  end
103
103
  publ = asso.xpath('frnic:publ', EPPClient::SCHEMAS_URL)
@@ -182,31 +182,31 @@ module EPPClient
182
182
 
183
183
  def contact_info_process(xml) #:nodoc:
184
184
  ret = super
185
- if (contact = xml.xpath('epp:extension/frnic:ext/frnic:resData/frnic:infData/frnic:contact', EPPClient::SCHEMAS_URL)).size > 0
186
- if (list = contact.xpath('frnic:list', EPPClient::SCHEMAS_URL)).size > 0
185
+ unless (contact = xml.xpath('epp:extension/frnic:ext/frnic:resData/frnic:infData/frnic:contact', EPPClient::SCHEMAS_URL)).empty?
186
+ unless (list = contact.xpath('frnic:list', EPPClient::SCHEMAS_URL)).empty?
187
187
  ret[:list] = list.map(&:text)
188
188
  end
189
- if (firstName = contact.xpath('frnic:firstName', EPPClient::SCHEMAS_URL)).size > 0
189
+ unless (firstName = contact.xpath('frnic:firstName', EPPClient::SCHEMAS_URL)).empty?
190
190
  ret[:firstName] = firstName.text
191
191
  end
192
- if (iI = contact.xpath('frnic:individualInfos', EPPClient::SCHEMAS_URL)).size > 0
192
+ unless (iI = contact.xpath('frnic:individualInfos', EPPClient::SCHEMAS_URL)).empty?
193
193
  ret[:individualInfos] = {}
194
194
  ret[:individualInfos][:birthDate] = Date.parse(iI.xpath('frnic:birthDate', EPPClient::SCHEMAS_URL).text)
195
- if (r = iI.xpath('frnic:idStatus', EPPClient::SCHEMAS_URL)).size > 0
195
+ unless (r = iI.xpath('frnic:idStatus', EPPClient::SCHEMAS_URL)).empty?
196
196
  ret[:individualInfos][:idStatus] = { :value => r.text }
197
197
  ret[:individualInfos][:idStatus][:when] = r.attr('when').value if r.attr('when')
198
198
  ret[:individualInfos][:idStatus][:source] = r.attr('source').value if r.attr('source')
199
199
  end
200
200
  %w(birthCity birthPc birthCc).each do |val|
201
- if (r = iI.xpath("frnic:#{val}", EPPClient::SCHEMAS_URL)).size > 0
201
+ unless (r = iI.xpath("frnic:#{val}", EPPClient::SCHEMAS_URL)).empty?
202
202
  ret[:individualInfos][val.to_sym] = r.text
203
203
  end
204
204
  end
205
205
  end
206
- if (leI = contact.xpath('frnic:legalEntityInfos', EPPClient::SCHEMAS_URL)).size > 0
206
+ unless (leI = contact.xpath('frnic:legalEntityInfos', EPPClient::SCHEMAS_URL)).empty?
207
207
  ret[:legalEntityInfos] = legalEntityInfos(leI)
208
208
  end
209
- if (obsoleted = contact.xpath('frnic:obsoleted', EPPClient::SCHEMAS_URL)).size > 0
209
+ unless (obsoleted = contact.xpath('frnic:obsoleted', EPPClient::SCHEMAS_URL)).empty?
210
210
  if obsoleted.text != '0'
211
211
  ret[:obsoleted] = {}
212
212
  if (v_when = obsoleted.attr('when'))
@@ -214,7 +214,7 @@ module EPPClient
214
214
  end
215
215
  end
216
216
  end
217
- if (reachable = contact.xpath('frnic:reachable', EPPClient::SCHEMAS_URL)).size > 0
217
+ unless (reachable = contact.xpath('frnic:reachable', EPPClient::SCHEMAS_URL)).empty?
218
218
  if reachable.text != '0'
219
219
  ret[:reachable] = {}
220
220
  if (v_when = reachable.attr('when'))
@@ -278,7 +278,7 @@ module EPPClient
278
278
  if contact.key?(:reachable)
279
279
  reachable = contact[:reachable]
280
280
 
281
- fail ArgumentError, 'reachable has to be a Hash' unless reachable.is_a?(Hash)
281
+ raise ArgumentError, 'reachable has to be a Hash' unless reachable.is_a?(Hash)
282
282
 
283
283
  xml.reachable(reachable, 1)
284
284
  end
@@ -362,7 +362,7 @@ module EPPClient
362
362
 
363
363
  def contact_create_process(xml) #:nodoc:
364
364
  ret = super
365
- if (creData = xml.xpath('epp:extension/frnic:ext/frnic:resData/frnic:creData', EPPClient::SCHEMAS_URL)).size > 0
365
+ unless (creData = xml.xpath('epp:extension/frnic:ext/frnic:resData/frnic:creData', EPPClient::SCHEMAS_URL)).empty?
366
366
  ret[:nhStatus] = creData.xpath('frnic:nhStatus', EPPClient::SCHEMAS_URL).attr('new').value == '1'
367
367
  ret[:idStatus] = creData.xpath('frnic:idStatus', EPPClient::SCHEMAS_URL).text
368
368
  end
@@ -373,14 +373,14 @@ module EPPClient
373
373
  # <tt>:ns</tt>, <tt>:dsData</tt> or <tt>:keyData</tt> records, AFNIC's
374
374
  # servers sends quite a strange error when there is.
375
375
  def domain_create(args)
376
- fail ArgumentError, "You can't create a domain with ns records, you must do an update afterwards" if args.key?(:ns)
377
- fail ArgumentError, "You can't create a domain with ds or key records, you must do an update afterwards" if args.key?(:dsData) || args.key?(:keyData)
376
+ raise ArgumentError, "You can't create a domain with ns records, you must do an update afterwards" if args.key?(:ns)
377
+ raise ArgumentError, "You can't create a domain with ds or key records, you must do an update afterwards" if args.key?(:dsData) || args.key?(:keyData)
378
378
  super
379
379
  end
380
380
 
381
381
  # Raises an exception, as contacts are deleted with a garbage collector.
382
382
  def contact_delete(_args)
383
- fail NotImplementedError, 'Contacts are deleted with a garbage collector'
383
+ raise NotImplementedError, 'Contacts are deleted with a garbage collector'
384
384
  end
385
385
 
386
386
  def contact_update_xml(args) #:nodoc:
@@ -400,7 +400,7 @@ module EPPClient
400
400
  if args[c].key?(:reachable)
401
401
  reachable = args[c][:reachable]
402
402
 
403
- fail ArgumentError, 'reachable has to be a Hash' unless reachable.is_a?(Hash)
403
+ raise ArgumentError, 'reachable has to be a Hash' unless reachable.is_a?(Hash)
404
404
 
405
405
  xml.reachable(reachable, 1)
406
406
  end
@@ -441,13 +441,13 @@ module EPPClient
441
441
  # * update status & authInfo
442
442
  def domain_update(args)
443
443
  if args.key?(:chg) && args[:chg].key?(:registrant)
444
- fail ArgumentError, 'You need to do a trade or recover operation to change the registrant'
444
+ raise ArgumentError, 'You need to do a trade or recover operation to change the registrant'
445
445
  end
446
446
  has_contacts = args.key?(:add) && args[:add].key?(:contacts) || args.key?(:add) && args[:add].key?(:contacts)
447
447
  has_ns = args.key?(:add) && args[:add].key?(:ns) || args.key?(:add) && args[:add].key?(:ns)
448
448
  has_other = args.key?(:add) && args[:add].key?(:status) || args.key?(:add) && args[:add].key?(:status) || args.key?(:chg) && args[:chg].key?(:authInfo)
449
449
  if [has_contacts, has_ns, has_other].count { |v| v } > 1
450
- fail ArgumentError, "You can't update all that at one time"
450
+ raise ArgumentError, "You can't update all that at one time"
451
451
  end
452
452
  [:add, :rem].each do |ar|
453
453
  if args.key?(ar) && args[ar].key?(:ns) && args[ar][:ns].first.is_a?(String)
@@ -471,15 +471,15 @@ module EPPClient
471
471
  qP = contact.xpath('frnic:qualificationProcess', EPPClient::SCHEMAS_URL)
472
472
  ret[:qualificationProcess] = { :s => qP.attr('s').value }
473
473
  ret[:qualificationProcess][:lang] = qP.attr('lang').value if qP.attr('lang')
474
- if (leI = contact.xpath('frnic:legalEntityInfos', EPPClient::SCHEMAS_URL)).size > 0
474
+ unless (leI = contact.xpath('frnic:legalEntityInfos', EPPClient::SCHEMAS_URL)).empty?
475
475
  ret[:legalEntityInfos] = legalEntityInfos(leI)
476
476
  end
477
477
  reach = contact.xpath('frnic:reachability', EPPClient::SCHEMAS_URL)
478
478
  ret[:reachability] = { :reStatus => reach.xpath('frnic:reStatus', EPPClient::SCHEMAS_URL).text }
479
- if (voice = reach.xpath('frnic:voice', EPPClient::SCHEMAS_URL)).size > 0
479
+ unless (voice = reach.xpath('frnic:voice', EPPClient::SCHEMAS_URL)).empty?
480
480
  ret[:reachability][:voice] = voice.text
481
481
  end
482
- if (email = reach.xpath('frnic:email', EPPClient::SCHEMAS_URL)).size > 0
482
+ unless (email = reach.xpath('frnic:email', EPPClient::SCHEMAS_URL)).empty?
483
483
  ret[:reachability][:email] = email.text
484
484
  end
485
485
  ret
@@ -499,12 +499,12 @@ module EPPClient
499
499
 
500
500
  # FIXME: there are discrepencies between the 1.2 xmlschema, the documentation and the reality, I'm trying to stick to reality here.
501
501
  %w(reHldID acHldID).each do |f|
502
- if (field = dom.xpath("frnic:#{f}", EPPClient::SCHEMAS_URL)).size > 0
502
+ unless (field = dom.xpath("frnic:#{f}", EPPClient::SCHEMAS_URL)).empty?
503
503
  ret[f.to_sym] = field.text
504
504
  end
505
505
  end
506
506
  %w(rhDate ahDate).each do |f|
507
- if (field = dom.xpath("frnic:#{f}", EPPClient::SCHEMAS_URL)).size > 0
507
+ unless (field = dom.xpath("frnic:#{f}", EPPClient::SCHEMAS_URL)).empty?
508
508
  ret[f.to_sym] = DateTime.parse(field.text)
509
509
  end
510
510
  end
metadata CHANGED
@@ -1,86 +1,106 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: epp-client-afnic
3
- version: !ruby/object:Gem::Version
4
- version: 0.15.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.15.1
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Mathieu Arnold
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2016-02-17 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
11
+ date: 2016-02-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
- prerelease: false
17
- requirement: &id001 !ruby/object:Gem::Requirement
18
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
19
17
  - - ">="
20
- - !ruby/object:Gem::Version
18
+ - !ruby/object:Gem::Version
21
19
  version: 1.0.0
22
20
  type: :development
23
- version_requirements: *id001
24
- - !ruby/object:Gem::Dependency
25
- name: nokogiri
26
21
  prerelease: false
27
- requirement: &id002 !ruby/object:Gem::Requirement
28
- requirements:
29
- - - ~>
30
- - !ruby/object:Gem::Version
31
- version: "1.4"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: nokogiri
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.4'
32
34
  type: :runtime
33
- version_requirements: *id002
34
- - !ruby/object:Gem::Dependency
35
- name: builder
36
35
  prerelease: false
37
- requirement: &id003 !ruby/object:Gem::Requirement
38
- requirements:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.4'
41
+ - !ruby/object:Gem::Dependency
42
+ name: builder
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
39
45
  - - ">="
40
- - !ruby/object:Gem::Version
46
+ - !ruby/object:Gem::Version
41
47
  version: 2.1.2
42
48
  type: :runtime
43
- version_requirements: *id003
44
- - !ruby/object:Gem::Dependency
45
- name: epp-client-base
46
49
  prerelease: false
47
- requirement: &id004 !ruby/object:Gem::Requirement
48
- requirements:
49
- - - "="
50
- - !ruby/object:Gem::Version
51
- version: 0.15.0
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 2.1.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: epp-client-base
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.15.1
52
62
  type: :runtime
53
- version_requirements: *id004
54
- - !ruby/object:Gem::Dependency
55
- name: epp-client-rgp
56
63
  prerelease: false
57
- requirement: &id005 !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "="
60
- - !ruby/object:Gem::Version
61
- version: 0.15.0
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 0.15.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: epp-client-rgp
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 0.15.1
62
76
  type: :runtime
63
- version_requirements: *id005
64
- - !ruby/object:Gem::Dependency
65
- name: epp-client-secdns
66
77
  prerelease: false
67
- requirement: &id006 !ruby/object:Gem::Requirement
68
- requirements:
69
- - - "="
70
- - !ruby/object:Gem::Version
71
- version: 0.15.0
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 0.15.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: epp-client-secdns
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 0.15.1
72
90
  type: :runtime
73
- version_requirements: *id006
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 0.15.1
74
97
  description: AFNIC EPP client library.
75
- email:
98
+ email:
76
99
  - m@absolight.fr
77
100
  executables: []
78
-
79
101
  extensions: []
80
-
81
102
  extra_rdoc_files: []
82
-
83
- files:
103
+ files:
84
104
  - ChangeLog
85
105
  - EXAMPLE.AFNIC
86
106
  - Gemfile
@@ -96,30 +116,25 @@ files:
96
116
  - vendor/afnic/frnic-1.4.xsd
97
117
  homepage: https://github.com/Absolight/epp-client
98
118
  licenses: []
99
-
100
119
  metadata: {}
101
-
102
120
  post_install_message:
103
121
  rdoc_options: []
104
-
105
- require_paths:
122
+ require_paths:
106
123
  - lib
107
- required_ruby_version: !ruby/object:Gem::Requirement
108
- requirements:
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ requirements:
109
126
  - - ">="
110
- - !ruby/object:Gem::Version
127
+ - !ruby/object:Gem::Version
111
128
  version: 1.8.7
112
- required_rubygems_version: !ruby/object:Gem::Requirement
113
- requirements:
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
+ requirements:
114
131
  - - ">="
115
- - !ruby/object:Gem::Version
132
+ - !ruby/object:Gem::Version
116
133
  version: 1.3.6
117
134
  requirements: []
118
-
119
135
  rubyforge_project:
120
- rubygems_version: 2.0.17
136
+ rubygems_version: 2.4.8
121
137
  signing_key:
122
138
  specification_version: 4
123
139
  summary: AFNIC EPP client library
124
140
  test_files: []
125
-