alfi 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/alfi.rb +7 -2
  3. data/lib/alfi/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46fd577c0cba4e579fe01b8d4e806b2a049c8403
4
- data.tar.gz: e6e1bfc12c7724f208d3380bef3c1b039854e224
3
+ metadata.gz: 3bcd9ec52a7e800287c4319869ea4aaa042c1a18
4
+ data.tar.gz: 53ec60c9fdf4dd0b6bbf8c5c1e4c8ef05db6ad6d
5
5
  SHA512:
6
- metadata.gz: 1621527f0f1f3308be0dc7e1806a7a31622f383fcf4c85041f9c56c6d4f620ff6dc66466220f2a76e9e3156b5127297a320b8f9609ceed43c1c65ed963d65ec9
7
- data.tar.gz: 21af644bd0174b97bf01e3cedbc66dcca97f2ade6d5fe3ee467e955771ca228977b4f06b83002a5a63915bda9018a81cc75a01c05540639e57a4f8c1ebba194e
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
- response = http.request(request)
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
@@ -1,3 +1,3 @@
1
1
  module Alfi
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alfi
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
  - cesar ferreira