namecheap-client 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/namecheap-client.rb +10 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c66c8ab2cb269a6d84e9511188f1d3e6b391397131c7ddaeb5bea825024b9dcb
|
4
|
+
data.tar.gz: ff00284b996c1d50d9b7b5295295387aef22aecf4d791122627058d945f57621
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 801959101b211c6912e3094d3aeec7ab6a6726c35c6c0233d189647de50d1a8d86153ce10285054ad9b1bfc07b1c568887abf005818ff27c2d73b4f3ebd09339
|
7
|
+
data.tar.gz: 01a7d5497f7ad6b5205e5bc58d24a89f41ec01fc5802996a352e819511a04f803b0889b2ad4530010b25bd6ee0d990aaeb4423551eb434e851ef061188b47539
|
data/lib/namecheap-client.rb
CHANGED
@@ -154,7 +154,16 @@ class NamecheapClient
|
|
154
154
|
end
|
155
155
|
|
156
156
|
def parse_errors(xml_response)
|
157
|
-
|
157
|
+
# Parse the XML if it's a string; otherwise, assume it's already a Nokogiri document
|
158
|
+
doc = xml_response.is_a?(String) ? Nokogiri::XML(xml_response) : xml_response
|
159
|
+
|
160
|
+
# Define the namespace with a prefix (e.g., 'nc' for Namecheap)
|
161
|
+
namespaces = { 'nc' => 'http://api.namecheap.com/xml.response' }
|
162
|
+
|
163
|
+
# Use the namespace prefix in your XPath query
|
164
|
+
errors = doc.xpath('//nc:Errors/nc:Error', namespaces).map(&:text)
|
165
|
+
|
166
|
+
# Join the error messages with a semicolon and space
|
158
167
|
errors.join('; ')
|
159
168
|
end
|
160
169
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: namecheap-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-http
|