contact-data 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.coveralls.yml +3 -0
- data/README.md +3 -2
- data/lib/contact-data/fetcher.rb +3 -9
- data/lib/contact-data/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c0323cd517654462549ac589fec8dcbab71174b
|
|
4
|
+
data.tar.gz: fb30d5f2babc58b1c66fb2bd6f02934b5ff929ff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d93463479baf4139ae80c58e34efcaf34cbd0fb8315a3e915279cb51b6b917b6e642e0038f8081e959783f80a47d6ef735f8f91f5249cbb085aa931e682b861
|
|
7
|
+
data.tar.gz: 9bf4563078d7b630de1ecb02c61868db83e24e87c1efa90d21df56c538d25d448ceba7498565e4e8e29e3c2a35049870f4565bb033d6a27437b7e041c04c4c60
|
data/.coveralls.yml
ADDED
data/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# The contact-data gem
|
|
2
2
|
|
|
3
3
|
 [](https://codeclimate.com/github/Xenapto/contact-data) [](https://coveralls.io/r/Xenapto/contact-data?branch=master)
|
|
4
|
-
[
|
|
4
|
+
[](https://hakiri.io/github/Xenapto/contact-data/develop)
|
|
5
|
+

|
|
6
|
+
[](http://xenapto.com)
|
|
6
7
|
|
|
7
8
|
Retrieves information about people and organizations from http://public.xenapto.com
|
|
8
9
|
|
data/lib/contact-data/fetcher.rb
CHANGED
|
@@ -9,7 +9,7 @@ module ContactData
|
|
|
9
9
|
attr_reader :http_method, :api_method, :options
|
|
10
10
|
|
|
11
11
|
URL = ENV['XENDATA_URL'] || 'http://public.xenapto.com'
|
|
12
|
-
API = 'api/v2'
|
|
12
|
+
API = 'api/v2'.freeze
|
|
13
13
|
|
|
14
14
|
LOGLEVEL = Logger::WARN
|
|
15
15
|
|
|
@@ -28,13 +28,7 @@ module ContactData
|
|
|
28
28
|
|
|
29
29
|
def url
|
|
30
30
|
return @url if @url
|
|
31
|
-
|
|
32
|
-
if api_method.is_a?(String)
|
|
33
|
-
@url = "#{url_base}/#{api_method}"
|
|
34
|
-
else
|
|
35
|
-
@url = "#{api_base}/#{method_base}#{api_method}"
|
|
36
|
-
end
|
|
37
|
-
|
|
31
|
+
@url = api_method.is_a?(String) ? "#{url_base}/#{api_method}" : "#{api_base}/#{method_base}#{api_method}"
|
|
38
32
|
@url = "#{@url}.#{options[:format] || :json}" unless options[:noformat]
|
|
39
33
|
@url
|
|
40
34
|
end
|
|
@@ -68,7 +62,7 @@ module ContactData
|
|
|
68
62
|
return @json if @json
|
|
69
63
|
logger.info { "Using #{display_method} for #{url}" }
|
|
70
64
|
@json = RestClient::Request.new(args).execute
|
|
71
|
-
rescue RestClient::Exception => e
|
|
65
|
+
rescue RestClient::Exception, SocketError => e
|
|
72
66
|
raise ContactData::FetchError, "#{e.message} when trying to #{display_method} url: #{url}", e.backtrace
|
|
73
67
|
end
|
|
74
68
|
|
data/lib/contact-data/version.rb
CHANGED
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.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Xenapto
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-01-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|
|
@@ -213,6 +213,7 @@ executables: []
|
|
|
213
213
|
extensions: []
|
|
214
214
|
extra_rdoc_files: []
|
|
215
215
|
files:
|
|
216
|
+
- ".coveralls.yml"
|
|
216
217
|
- ".env"
|
|
217
218
|
- ".gitignore"
|
|
218
219
|
- ".hound.yml"
|