contact-data 0.1.0 → 0.2.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: e047c67be460d782f2b82819f4e83c9e0b4a0559
4
- data.tar.gz: 27e01e968cd31a67276825899a8b60629cd9c1f6
3
+ metadata.gz: b9fd4a7e795248e243dea1dee296dead465d6d12
4
+ data.tar.gz: 9d2a99a60ac49a17327fd6bbe357568b207ca0fd
5
5
  SHA512:
6
- metadata.gz: a735e12d551c72399df8b724b7fd9223fbde49f61f88e05624b8102eb2bb7d449a9fd85fcd4d9c58fbbd9e2190bd087ece2a8b9f42b016bd9c651fa08fc93db7
7
- data.tar.gz: ac9b74436b8e38a97a9908a54456e1c374ae8f8a397e3bfc62116d86616d8252ed2cbda49e0e876a6b7168deb54feb70da3b16d94416603442d9b0474dc74744
6
+ metadata.gz: ff6d9c0a9c8520a9e7dbcc2cfe53e60aaae1631dc85a9554e3db8d994b2b378043cac4163f783f52be7a439540158e1dfa55f6fa8d46a2e0c009e4367b218c0e
7
+ data.tar.gz: 93ae324d45583d1e94222718c2c274c4cf98cc912b8c7f053f5dae21058cf87f014197e87551776ff21ec0bc20a613c02895314ce9c84f8438a376c8466b8ef9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- contact-data (0.0.20)
4
+ contact-data (0.1.0)
5
5
  addressable (~> 2.3)
6
6
  rest-client (~> 1)
7
7
 
@@ -2,8 +2,10 @@
2
2
  module ContactData
3
3
  class Deprecated
4
4
  class << self
5
- def search(name)
6
- Fetcher.get("name/#{Fetcher.encode_component name}")
5
+ def search(name, contact_type = nil)
6
+ options = {}
7
+ options[:params] = { contact_type: contact_type } if contact_type
8
+ Fetcher.get("name/#{Fetcher.encode_component name}", options)
7
9
  end
8
10
 
9
11
  def find_contacts_in(text)
@@ -1,4 +1,4 @@
1
1
  # Gem version
2
2
  module ContactData
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
@@ -15,6 +15,14 @@ describe ContactData::Deprecated do
15
15
  end
16
16
  end
17
17
 
18
+ it 'searches by name with a contact type' do
19
+ VCR.use_cassette('deprecated_contact_search') do
20
+ result = ContactData::Deprecated.search(name, :person)
21
+ expect(result).to be_a(Hash)
22
+ expect(result[:count]).to eq(10)
23
+ end
24
+ end
25
+
18
26
  it 'searches successfully with name that gave XML bug' do
19
27
  VCR.use_cassette('deprecated_contact_search') do
20
28
  result = ContactData::Deprecated.search(name_xml_bug)
@@ -121,4 +121,80 @@ http_interactions:
121
121
  string: '{"contacts":[],"name":"Not found","slug":"xxxxxxxxxx","count":0,"version":"v1"}'
122
122
  http_version:
123
123
  recorded_at: Thu, 14 Aug 2014 11:01:50 GMT
124
+ - request:
125
+ method: get
126
+ uri: http://public.xenapto.com/name/Derek%20Jones%20III.json?contact_type=person
127
+ body:
128
+ encoding: US-ASCII
129
+ string: ''
130
+ headers:
131
+ Accept:
132
+ - "*/*; q=0.5, application/xml"
133
+ Accept-Encoding:
134
+ - gzip, deflate
135
+ User-Agent:
136
+ - Ruby
137
+ response:
138
+ status:
139
+ code: 200
140
+ message: OK
141
+ headers:
142
+ Date:
143
+ - Wed, 27 Aug 2014 13:52:22 GMT
144
+ Status:
145
+ - 200 OK
146
+ Connection:
147
+ - close
148
+ Content-Type:
149
+ - application/json; charset=utf-8
150
+ Content-Length:
151
+ - '9689'
152
+ X-Ua-Compatible:
153
+ - IE=Edge,chrome=1
154
+ Etag:
155
+ - '"49d18f6af06ace2bcb7fa2dc8477327d"'
156
+ Cache-Control:
157
+ - max-age=0, private, must-revalidate
158
+ X-Request-Id:
159
+ - 5ccd546b652b40f063e8e7934766502e
160
+ X-Runtime:
161
+ - '0.485282'
162
+ X-Rack-Cache:
163
+ - miss
164
+ body:
165
+ encoding: UTF-8
166
+ string: '{"contacts":[{"id":11942380,"updated_at":"2014-06-12T10:16:36Z","source":"fsa","name":"Derek
167
+ Jones","source_slug":"729794","canonical_slug":"derek-jones","website":null,"source_id":729794,"last_fetched":"2014-06-12T10:16:33Z","source_created_at":null,"source_updated_at":null,"contact_type":"person","source_namespace":"indiv","page_link":"http://www.fsa.gov.uk/register/indivBasicDetails.do?sid=729794","api_link":"/indivBasicDetails.do?sid=729794","description":null,"name_is_common_phrase":false,"levenshtein_distance":0,"source_priority":6,"identities":[{"created_at":"2013-12-12T07:29:07Z","description":"Derek
168
+ Jones","service":"avatar","slug":null,"updated_at":"2013-12-12T07:29:07Z","url":null},{"created_at":"2013-12-12T07:29:07Z","description":"Derek
169
+ Jones","service":"fsa","slug":"dxj01321","updated_at":"2014-06-07T14:29:44Z","url":"http://www.fsa.gov.uk/register//indivbasicdetails.do?sid=729794"}],"relationships":[],"funding_rounds":[],"links":[]},{"id":11942381,"updated_at":"2014-06-12T10:16:28Z","source":"fsa","name":"Derek
170
+ Jones","source_slug":"267093","canonical_slug":"derek-jones","website":null,"source_id":267093,"last_fetched":"2014-06-12T10:16:25Z","source_created_at":null,"source_updated_at":null,"contact_type":"person","source_namespace":"indiv","page_link":"http://www.fsa.gov.uk/register/indivBasicDetails.do?sid=267093","api_link":"/indivBasicDetails.do?sid=267093","description":null,"name_is_common_phrase":false,"levenshtein_distance":0,"source_priority":6,"identities":[{"created_at":"2013-12-12T07:28:46Z","description":"Derek
171
+ Jones","service":"avatar","slug":null,"updated_at":"2013-12-12T07:28:46Z","url":null},{"created_at":"2013-12-12T07:28:46Z","description":"Derek
172
+ Jones","service":"fsa","slug":"dxj00016","updated_at":"2014-06-06T23:04:55Z","url":"http://www.fsa.gov.uk/register//indivbasicdetails.do?sid=267093"}],"relationships":[],"funding_rounds":[],"links":[]},{"id":11942382,"updated_at":"2014-06-12T10:16:32Z","source":"fsa","name":"Derek
173
+ Jones","source_slug":"490042","canonical_slug":"derek-jones","website":null,"source_id":490042,"last_fetched":"2014-06-12T10:16:29Z","source_created_at":null,"source_updated_at":null,"contact_type":"person","source_namespace":"indiv","page_link":"http://www.fsa.gov.uk/register/indivBasicDetails.do?sid=490042","api_link":"/indivBasicDetails.do?sid=490042","description":null,"name_is_common_phrase":false,"levenshtein_distance":0,"source_priority":6,"identities":[{"created_at":"2013-12-12T07:28:57Z","description":"Derek
174
+ Jones","service":"avatar","slug":null,"updated_at":"2013-12-12T07:28:57Z","url":null},{"created_at":"2013-12-12T07:28:57Z","description":"Derek
175
+ Jones","service":"fsa","slug":"dxj01164","updated_at":"2014-06-06T23:04:59Z","url":"http://www.fsa.gov.uk/register//indivbasicdetails.do?sid=490042"}],"relationships":[],"funding_rounds":[],"links":[]},{"id":11942383,"updated_at":"2014-06-12T10:16:15Z","source":"fsa","name":"Derek
176
+ Jones","source_slug":"282759","canonical_slug":"derek-jones","website":null,"source_id":282759,"last_fetched":"2014-06-12T10:16:12Z","source_created_at":null,"source_updated_at":null,"contact_type":"person","source_namespace":"indiv","page_link":"http://www.fsa.gov.uk/register/indivBasicDetails.do?sid=282759","api_link":"/indivBasicDetails.do?sid=282759","description":null,"name_is_common_phrase":false,"levenshtein_distance":0,"source_priority":6,"identities":[{"created_at":"2013-12-12T07:28:47Z","description":"Derek
177
+ Jones","service":"avatar","slug":null,"updated_at":"2013-12-12T07:28:47Z","url":null},{"created_at":"2013-12-12T07:28:47Z","description":"Derek
178
+ Jones","service":"fsa","slug":"dxj00029","updated_at":"2014-06-07T14:29:30Z","url":"http://www.fsa.gov.uk/register//indivbasicdetails.do?sid=282759"}],"relationships":[],"funding_rounds":[],"links":[]},{"id":11942384,"updated_at":"2014-06-12T10:16:23Z","source":"fsa","name":"Derek
179
+ Andrew Jones","source_slug":"368843","canonical_slug":"derek-jones","website":null,"source_id":368843,"last_fetched":"2014-06-12T10:16:21Z","source_created_at":null,"source_updated_at":null,"contact_type":"person","source_namespace":"indiv","page_link":"http://www.fsa.gov.uk/register/indivBasicDetails.do?sid=368843","api_link":"/indivBasicDetails.do?sid=368843","description":null,"name_is_common_phrase":false,"levenshtein_distance":0,"source_priority":6,"identities":[{"created_at":"2013-12-12T07:28:51Z","description":"Derek
180
+ Andrew Jones","service":"avatar","slug":null,"updated_at":"2013-12-12T07:28:51Z","url":null},{"created_at":"2013-12-12T07:28:51Z","description":"Derek
181
+ Andrew Jones","service":"fsa","slug":"daj01053","updated_at":"2014-06-07T14:29:38Z","url":"http://www.fsa.gov.uk/register//indivbasicdetails.do?sid=368843"}],"relationships":[],"funding_rounds":[],"links":[]},{"id":11942385,"updated_at":"2014-06-12T10:16:19Z","source":"fsa","name":"Derek
182
+ John Jones","source_slug":"360573","canonical_slug":"derek-jones","website":null,"source_id":360573,"last_fetched":"2014-06-12T10:16:17Z","source_created_at":null,"source_updated_at":null,"contact_type":"person","source_namespace":"indiv","page_link":"http://www.fsa.gov.uk/register/indivBasicDetails.do?sid=360573","api_link":"/indivBasicDetails.do?sid=360573","description":null,"name_is_common_phrase":false,"levenshtein_distance":0,"source_priority":6,"identities":[{"created_at":"2013-12-12T07:28:51Z","description":"Derek
183
+ John Jones","service":"avatar","slug":null,"updated_at":"2013-12-12T07:28:51Z","url":null},{"created_at":"2013-12-12T07:28:51Z","description":"Derek
184
+ John Jones","service":"fsa","slug":"djj01040","updated_at":"2014-06-07T14:29:34Z","url":"http://www.fsa.gov.uk/register//indivbasicdetails.do?sid=360573"}],"relationships":[],"funding_rounds":[],"links":[]},{"id":11942386,"updated_at":"2014-06-12T10:16:48Z","source":"fsa","name":"Derek
185
+ Leslie Jones","source_slug":"568698","canonical_slug":"derek-jones","website":null,"source_id":568698,"last_fetched":"2014-06-12T10:16:45Z","source_created_at":null,"source_updated_at":null,"contact_type":"person","source_namespace":"indiv","page_link":"http://www.fsa.gov.uk/register/indivBasicDetails.do?sid=568698","api_link":"/indivBasicDetails.do?sid=568698","description":null,"name_is_common_phrase":false,"levenshtein_distance":0,"source_priority":6,"identities":[{"created_at":"2013-12-12T07:29:03Z","description":"Derek
186
+ Leslie Jones","service":"avatar","slug":null,"updated_at":"2013-12-12T07:29:03Z","url":null},{"created_at":"2013-12-12T07:29:03Z","description":"Derek
187
+ Leslie Jones","service":"fsa","slug":"dlj01043","updated_at":"2014-06-07T14:29:56Z","url":"http://www.fsa.gov.uk/register//indivbasicdetails.do?sid=568698"}],"relationships":[],"funding_rounds":[],"links":[]},{"id":11942387,"updated_at":"2014-06-12T10:16:43Z","source":"fsa","name":"Derek
188
+ Peter Jones","source_slug":"521125","canonical_slug":"derek-jones","website":null,"source_id":521125,"last_fetched":"2014-06-12T10:16:41Z","source_created_at":null,"source_updated_at":null,"contact_type":"person","source_namespace":"indiv","page_link":"http://www.fsa.gov.uk/register/indivBasicDetails.do?sid=521125","api_link":"/indivBasicDetails.do?sid=521125","description":null,"name_is_common_phrase":false,"levenshtein_distance":0,"source_priority":6,"identities":[{"created_at":"2013-12-12T07:28:59Z","description":"Derek
189
+ Peter Jones","service":"avatar","slug":null,"updated_at":"2013-12-12T07:28:59Z","url":null},{"created_at":"2013-12-12T07:28:59Z","description":"Derek
190
+ Peter Jones","service":"fsa","slug":"dpj01028","updated_at":"2014-06-07T14:29:52Z","url":"http://www.fsa.gov.uk/register//indivbasicdetails.do?sid=521125"}],"relationships":[],"funding_rounds":[],"links":[]},{"id":11942388,"updated_at":"2014-06-12T10:16:39Z","source":"fsa","name":"Derek
191
+ Powell Jones","source_slug":"370909","canonical_slug":"derek-jones","website":null,"source_id":370909,"last_fetched":"2014-06-12T10:16:37Z","source_created_at":null,"source_updated_at":null,"contact_type":"person","source_namespace":"indiv","page_link":"http://www.fsa.gov.uk/register/indivBasicDetails.do?sid=370909","api_link":"/indivBasicDetails.do?sid=370909","description":null,"name_is_common_phrase":false,"levenshtein_distance":0,"source_priority":6,"identities":[{"created_at":"2013-12-12T07:28:52Z","description":"Derek
192
+ Powell Jones","service":"avatar","slug":null,"updated_at":"2013-12-12T07:28:52Z","url":null},{"created_at":"2013-12-12T07:28:52Z","description":"Derek
193
+ Powell Jones","service":"fsa","slug":"dpj01022","updated_at":"2014-06-07T14:29:48Z","url":"http://www.fsa.gov.uk/register//indivbasicdetails.do?sid=370909"}],"relationships":[],"funding_rounds":[],"links":[]},{"id":11942389,"updated_at":"2014-06-12T10:16:53Z","source":"fsa","name":"Derek
194
+ Robert Jones","source_slug":"720500","canonical_slug":"derek-jones","website":null,"source_id":720500,"last_fetched":"2014-06-12T10:16:50Z","source_created_at":null,"source_updated_at":null,"contact_type":"person","source_namespace":"indiv","page_link":"http://www.fsa.gov.uk/register/indivBasicDetails.do?sid=720500","api_link":"/indivBasicDetails.do?sid=720500","description":null,"name_is_common_phrase":false,"levenshtein_distance":0,"source_priority":6,"identities":[{"created_at":"2013-12-12T07:29:06Z","description":"Derek
195
+ Robert Jones","service":"avatar","slug":null,"updated_at":"2013-12-12T07:29:06Z","url":null},{"created_at":"2013-12-12T07:29:06Z","description":"Derek
196
+ Robert Jones","service":"fsa","slug":"drj01066","updated_at":"2014-06-07T14:30:00Z","url":"http://www.fsa.gov.uk/register//indivbasicdetails.do?sid=720500"}],"relationships":[],"funding_rounds":[],"links":[]}],"name":"Derek
197
+ Jones","slug":"derek-jones","count":10,"version":"v1"}'
198
+ http_version:
199
+ recorded_at: Wed, 27 Aug 2014 13:52:22 GMT
124
200
  recorded_with: VCR 2.9.2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contact-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xenapto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-14 00:00:00.000000000 Z
11
+ date: 2014-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client