contact-data 0.3.2 → 0.3.3

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: 056b5029d39458ef3c8bf58eebd14d20441258d8
4
- data.tar.gz: d0ce98b7105cfd7d12fb80f397b1be78f727016f
3
+ metadata.gz: 1b19cdf106f78f91e24a07aa90dda177de46f691
4
+ data.tar.gz: d3b9d5e394f36192371606eee9ca089fe42a8a5e
5
5
  SHA512:
6
- metadata.gz: 52dfba849663fa9b212da65be1b86c56d602259ba240f8da38b1444fea0e5711cb4335b2b07e23d3071cc8681370dbbdfe888e60098916c154b54c79904775a1
7
- data.tar.gz: 220a95a1e0f7b4db1373a10fe2dcba2220b67a37c89222aed1946b5e202f2b70d28d6803be1dd16395491e5c9b3ae4934ad7876e34118f5d9096f9ec6c25b3af
6
+ metadata.gz: b64ce6b2af8021bcf56e34c577943eeaa2e6797c63fd1acfc33405f0dca46f1cbe13eebb0d111ab0f7a5056cd2636900cb44f33f056255ab35ac44e55f487ed9
7
+ data.tar.gz: 6f2d87554d21fd5cb30bd748c25236d9e28a17c98e770183fa4147472e1f5df925c807593ce1b0731940094ae76e8a5f164b92e5bc81d12056d909f81060edb1
@@ -14,7 +14,7 @@ module ContactData
14
14
  end
15
15
 
16
16
  def search(params = {})
17
- params[:timeout] ||= 600
17
+ params[:timeout] ||= 600 if params.is_a? Hash
18
18
  Fetcher.get :search, params.to_options(BASE)
19
19
  end
20
20
  end
@@ -5,7 +5,7 @@ module ContactData
5
5
  BASE = :text
6
6
 
7
7
  def self.search(text = nil, params = {})
8
- params[:timeout] ||= 600
8
+ params[:timeout] ||= 600 if params.is_a? Hash
9
9
  Fetcher.post :search, params.to_options(BASE, text)
10
10
  end
11
11
  end
@@ -1,4 +1,4 @@
1
1
  # Gem version
2
2
  module ContactData
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.3'
4
4
  end
data/spec/fetcher_spec.rb CHANGED
@@ -8,7 +8,7 @@ describe ContactData::Fetcher do
8
8
  let(:url2) { 'http://example.com' }
9
9
 
10
10
  it 'adds diagnostic information to a RestClient exception' do
11
- RestClient::Request.any_instance.stub(:execute).and_raise RestClient::InternalServerError.new(nil, 500)
11
+ allow(RestClient::Request).to receive(:new).and_raise RestClient::InternalServerError.new(nil, 500)
12
12
 
13
13
  expect { ContactData::Fetcher.get(method) }.to raise_error { |e|
14
14
  expect(e).to be_an(ContactData::FetchError)
@@ -176,4 +176,52 @@ http_interactions:
176
176
  </hash>
177
177
  http_version:
178
178
  recorded_at: Fri, 15 May 2015 10:32:22 GMT
179
+ - request:
180
+ method: get
181
+ uri: http://public.xenapto.com/api/v2/links/search.json?timeout=600&url=http://iana.org
182
+ body:
183
+ encoding: US-ASCII
184
+ string: ''
185
+ headers:
186
+ Accept:
187
+ - "*/*; q=0.5, application/xml"
188
+ Accept-Encoding:
189
+ - gzip, deflate
190
+ User-Agent:
191
+ - Ruby
192
+ response:
193
+ status:
194
+ code: 200
195
+ message: OK
196
+ headers:
197
+ Date:
198
+ - Sat, 16 May 2015 16:53:17 GMT
199
+ Status:
200
+ - 200 OK
201
+ Connection:
202
+ - close
203
+ X-Frame-Options:
204
+ - SAMEORIGIN
205
+ X-Xss-Protection:
206
+ - 1; mode=block
207
+ X-Content-Type-Options:
208
+ - nosniff
209
+ Content-Type:
210
+ - application/json; charset=utf-8
211
+ Content-Length:
212
+ - '275'
213
+ Etag:
214
+ - W/"5f92b5c3e45ff95137379acb2af9d325"
215
+ Cache-Control:
216
+ - max-age=0, private, must-revalidate
217
+ X-Request-Id:
218
+ - 65be3337-1e8c-4bb2-8c2f-d12c47030df4
219
+ X-Runtime:
220
+ - '1.313432'
221
+ body:
222
+ encoding: UTF-8
223
+ string: '{"contacts":["int","arpa","global-ip","_______","apply","an"],"mentions":[],"emails":[],"id":null,"url":"http://www.iana.org/","domain":"iana.org","title":"Internet
224
+ Assigned Numbers Authority","news_source":"Internet Assigned Numbers Authority","summary":null,"version":"v2"}'
225
+ http_version:
226
+ recorded_at: Sat, 16 May 2015 16:53:17 GMT
179
227
  recorded_with: VCR 2.9.3
@@ -103,4 +103,107 @@ http_interactions:
103
103
  Williams","Intercom","Intercom.io"],"contact_types":["person","organization","organization"],"version":"v2"}'
104
104
  http_version:
105
105
  recorded_at: Fri, 15 May 2015 12:52:12 GMT
106
+ - request:
107
+ method: post
108
+ uri: http://public.xenapto.com/api/v2/text/search.json?timeout=600
109
+ body:
110
+ encoding: US-ASCII
111
+ string: text=%20%20%20%20%20%20%3Cspan%20style%3D%22font-family%3A%20-webkit-system-font%2C%20Helvetica%20Neue%2C%20Helvetica%2C%20sans-serif%3B%20color%3Argba(0%2C%200%2C%200%2C%201.0)%3B%22%0A%20%20%20%20%20%20class%3D%22%22%3E%3Cb%20class%3D%22%22%3EFrom%3A%20%3C%2Fb%3E%3C%2Fspan%3E%0A%20%20%20%20%20%20%3Cspan%20style%3D%22font-family%3A%20-webkit-system-font%2C%20Helvetica%20Neue%2C%20Helvetica%2C%20sans-serif%3B%22%0A%20%20%20%20%20%20class%3D%22%22%3EMax%20Williams%3Ca%20href%3D%22mailto%3Amax.williams%40pusher-4.mail.intercom.io%22%0A%20%20%20%20%20%20class%3D%22%22%3Emax.williams%40pusher-4.mail.intercom.io%3C%2Fa%3E%26gt%3B%3Cbr%20class%3D%22%22%3E%3C%2Fspan%3E%0A
112
+ headers:
113
+ Accept:
114
+ - "*/*; q=0.5, application/xml"
115
+ Accept-Encoding:
116
+ - gzip, deflate
117
+ Content-Length:
118
+ - '673'
119
+ Content-Type:
120
+ - application/x-www-form-urlencoded
121
+ User-Agent:
122
+ - Ruby
123
+ response:
124
+ status:
125
+ code: 200
126
+ message: OK
127
+ headers:
128
+ Date:
129
+ - Sat, 16 May 2015 16:53:18 GMT
130
+ Status:
131
+ - 200 OK
132
+ Connection:
133
+ - close
134
+ X-Frame-Options:
135
+ - SAMEORIGIN
136
+ X-Xss-Protection:
137
+ - 1; mode=block
138
+ X-Content-Type-Options:
139
+ - nosniff
140
+ Content-Type:
141
+ - application/json; charset=utf-8
142
+ Content-Length:
143
+ - '232'
144
+ Etag:
145
+ - W/"81b442e407e9c8bbac8308519c37a4e6"
146
+ Cache-Control:
147
+ - max-age=0, private, must-revalidate
148
+ X-Request-Id:
149
+ - 96e353f2-b761-4d73-b545-32e26cb3a464
150
+ X-Runtime:
151
+ - '0.621095'
152
+ body:
153
+ encoding: UTF-8
154
+ string: '{"contacts":["neue","intercom","intercom-io"],"mentions":[],"emails":["max.williams@pusher-4.mail.intercom.io"],"names":["Neue","Intercom","Intercom.io"],"contact_types":["organization","organization","organization"],"version":"v2"}'
155
+ http_version:
156
+ recorded_at: Sat, 16 May 2015 16:53:18 GMT
157
+ - request:
158
+ method: post
159
+ uri: http://public.xenapto.com/api/v2/text/search.json?input_format=html&timeout=600
160
+ body:
161
+ encoding: US-ASCII
162
+ string: text=%20%20%20%20%20%20%3Cspan%20style%3D%22font-family%3A%20-webkit-system-font%2C%20Helvetica%20Neue%2C%20Helvetica%2C%20sans-serif%3B%20color%3Argba(0%2C%200%2C%200%2C%201.0)%3B%22%0A%20%20%20%20%20%20class%3D%22%22%3E%3Cb%20class%3D%22%22%3EFrom%3A%20%3C%2Fb%3E%3C%2Fspan%3E%0A%20%20%20%20%20%20%3Cspan%20style%3D%22font-family%3A%20-webkit-system-font%2C%20Helvetica%20Neue%2C%20Helvetica%2C%20sans-serif%3B%22%0A%20%20%20%20%20%20class%3D%22%22%3EMax%20Williams%3Ca%20href%3D%22mailto%3Amax.williams%40pusher-4.mail.intercom.io%22%0A%20%20%20%20%20%20class%3D%22%22%3Emax.williams%40pusher-4.mail.intercom.io%3C%2Fa%3E%26gt%3B%3Cbr%20class%3D%22%22%3E%3C%2Fspan%3E%0A
163
+ headers:
164
+ Accept:
165
+ - "*/*; q=0.5, application/xml"
166
+ Accept-Encoding:
167
+ - gzip, deflate
168
+ Content-Length:
169
+ - '673'
170
+ Content-Type:
171
+ - application/x-www-form-urlencoded
172
+ User-Agent:
173
+ - Ruby
174
+ response:
175
+ status:
176
+ code: 200
177
+ message: OK
178
+ headers:
179
+ Date:
180
+ - Sat, 16 May 2015 16:53:18 GMT
181
+ Status:
182
+ - 200 OK
183
+ Connection:
184
+ - close
185
+ X-Frame-Options:
186
+ - SAMEORIGIN
187
+ X-Xss-Protection:
188
+ - 1; mode=block
189
+ X-Content-Type-Options:
190
+ - nosniff
191
+ Content-Type:
192
+ - application/json; charset=utf-8
193
+ Content-Length:
194
+ - '242'
195
+ Etag:
196
+ - W/"bc904362c962aaeea2357476a1c2fbff"
197
+ Cache-Control:
198
+ - max-age=0, private, must-revalidate
199
+ X-Request-Id:
200
+ - 0cf91fc1-46a5-44bf-9b26-eb52379ac788
201
+ X-Runtime:
202
+ - '0.190762'
203
+ body:
204
+ encoding: UTF-8
205
+ string: '{"contacts":["max-williams","intercom","intercom-io"],"mentions":[],"emails":["max.williams@pusher-4.mail.intercom.io"],"names":["Max
206
+ Williams","Intercom","Intercom.io"],"contact_types":["person","organization","organization"],"version":"v2"}'
207
+ http_version:
208
+ recorded_at: Sat, 16 May 2015 16:53:18 GMT
106
209
  recorded_with: VCR 2.9.3
@@ -4,5 +4,5 @@ VCR.configure do |c|
4
4
  c.configure_rspec_metadata!
5
5
  c.cassette_library_dir = 'spec/support/cassettes'
6
6
  c.hook_into :webmock
7
- c.default_cassette_options = { record: :new_episodes }
7
+ # c.default_cassette_options = { record: :new_episodes }
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contact-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xenapto