alfi 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 +4 -4
- data/lib/alfi.rb +7 -2
- data/lib/alfi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bcd9ec52a7e800287c4319869ea4aaa042c1a18
|
4
|
+
data.tar.gz: 53ec60c9fdf4dd0b6bbf8c5c1e4c8ef05db6ad6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0621d957019fd571036861a78c7f62bdce3afc5234b28e7fb222b806c54088467b56d39dd366fb65a8dfbaa0ee335126b049e4d9299ca87a4be2931a42fca942
|
7
|
+
data.tar.gz: b0e7127a459eff671fdec65e0dd5564ac62d1a26ee97292ef45cff2b29c51f3fc2dda0cab42b34a9c2c9d5d0ea020168d03980319dcbf79a678ed7b3c0d66008
|
data/lib/alfi.rb
CHANGED
@@ -16,11 +16,16 @@ module Alfi
|
|
16
16
|
def self.fetch_results(query)
|
17
17
|
uri = URI.parse(query_url(query))
|
18
18
|
|
19
|
-
|
20
19
|
http = Net::HTTP.new(uri.host, uri.port)
|
21
20
|
request = Net::HTTP::Get.new(uri.request_uri)
|
22
21
|
|
23
|
-
|
22
|
+
begin
|
23
|
+
response = http.request(request)
|
24
|
+
rescue SocketError
|
25
|
+
puts "Internet Connection not available".red
|
26
|
+
exit 1
|
27
|
+
end
|
28
|
+
|
24
29
|
|
25
30
|
if response.code == '200'
|
26
31
|
result = JSON.parse(response.body)
|
data/lib/alfi/version.rb
CHANGED