hexillion 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e8cfd9597be0f53d98aa7a46153a7ed32a1f66d
4
- data.tar.gz: 5b64a7a7bebd0b67f082c3d19d9ffa2e689b995c
3
+ metadata.gz: 8c942f22c6a9559c161931f5ff15bd8dc84f619a
4
+ data.tar.gz: 4caa679c80350393774e0426f5b7cacd1d98f70a
5
5
  SHA512:
6
- metadata.gz: 3f8f4e9d592aae5b187a176aa637decbb211fc555d1d22b2cc3998adb45b2f77f04b221da0fc5e4065a18a464496287c983754d9f0d23ea020ee76f7186cdd4f
7
- data.tar.gz: 9a17946de7e3c0eb7f5fe10f71a04db3aafcca1534878588cd0b06fbe5912a069f667826fa23a0037991dc11c069f61c9a2802f4c931a3fc8fae01a1167095e3
6
+ metadata.gz: be33409227872f68598b8e20cf56b3d80f5b8bc71d891dde7b48b260bfd07a986efc07a69885dd636c28d6cc316c37caeb9e2c7d2435016dd8bf7632fb0e8727
7
+ data.tar.gz: 71b028acb32695c9b2e2d4fecb4f969a295925a8126777634db99304876df638b6a1741a41510c02a31e5e540651d6968d570c78f0fb89269dfebf2b0a119c2c
@@ -1,3 +1,6 @@
1
+ before_install:
2
+ - gem update bundler
3
+
1
4
  language: ruby
2
5
  rvm:
3
6
  - '2.1.0'
@@ -1,3 +1,6 @@
1
+ # 1.4.0
2
+ * Allow error code 'ParseFailed' in response.
3
+
1
4
  # 1.3.0
2
5
 
3
6
  * Replace rest-client usage with net/http.
@@ -52,7 +52,15 @@ module Hexillion
52
52
 
53
53
  def parse_xml(xml)
54
54
  doc = Nokogiri::XML(xml)
55
- records = doc.xpath(".//QueryResult[ErrorCode='Success' and FoundMatch='Yes']/WhoisRecord")
55
+
56
+ records = doc.xpath(
57
+ <<-XPATH
58
+ .//QueryResult[
59
+ (ErrorCode='Success' or ErrorCode='ParseFailed') and
60
+ FoundMatch='Yes'
61
+ ]/WhoisRecord
62
+ XPATH
63
+ )
56
64
 
57
65
  strings = {
58
66
  registrant_name: "Registrant Name",
@@ -1,3 +1,3 @@
1
1
  module Hexillion
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -134,5 +134,19 @@ describe Hexillion::Client do
134
134
 
135
135
  expect(@hex.whois("example.com")[:xml_response]).to eq(xml)
136
136
  end
137
+
138
+ it "allows error code 'ParseFailed' in response" do
139
+ @response_body = <<-XML
140
+ <QueryResult><ErrorCode>ParseFailed</ErrorCode><FoundMatch>Yes</FoundMatch><WhoisRecord>
141
+ <Registrant>
142
+ <Address>48 Cambridge Street</Address>
143
+ <Address>Level 3</Address>
144
+ <Email>me@example.com</Email>
145
+ </Registrant>
146
+ </WhoisRecord></QueryResult>
147
+ XML
148
+
149
+ expect(@hex.whois("example.com")[:registrant_email]).to eq("me@example.com")
150
+ end
137
151
  end
138
152
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hexillion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flippa Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-09 00:00:00.000000000 Z
11
+ date: 2017-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.6.8
93
+ rubygems_version: 2.6.11
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Provides a simple client for the Hexillion API