safeguard-api 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/safeguard-api/api.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDU4NmFkOWU2MGYxNGNjY2YzNTBhMzQ1ZGZiMWRhZTYxZDc5NDI1ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDcwZWM5MGRjYzhjNWU4ZTMxNjMwMmZkNmY5NGY0ZTZmNjYxYTJiNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWNmMTIzMGYzMzYwYzJhMTQ0ZTJhZTdmYWJlMDQxOTNlZTdlZjE0ODIxMGYw
|
10
|
+
NTYxNjU2ZDdlYjgyYjhiZDc5NWNkMDdmMmIyZDU1MjNkYWJmMWNiMDI5ZDRl
|
11
|
+
OWQyNzhkYzg1ZTRlNDc3ZDNmNWIzZjUwNGQ5ZTZkZTlmOWE1ZTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTAwZmY1ZmZmOWJmNjE2OWI4YzU3M2FhNzE4OWNiMzJhMTk4OTU3OTAxMDll
|
14
|
+
MzhmYWUxODJjMzg2ZjJlMWFjZWVjM2UzZjVjYzNmMTJhYWZiOWVjMzI0MTkz
|
15
|
+
Nzc3ZDAzM2NjMzg4MTQxNWY2M2I3ZjA2NjE2Mzg0NDE5MWJjOTg=
|
data/lib/safeguard-api/api.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'open-uri'
|
3
3
|
require 'json'
|
4
|
+
require 'httpclient'
|
4
5
|
module Safeguard
|
5
6
|
class API
|
6
7
|
|
@@ -16,8 +17,9 @@ module Safeguard
|
|
16
17
|
def self.get uri
|
17
18
|
begin
|
18
19
|
url = "#{Safeguard.api_uri}/#{uri}&api_key=#{Safeguard.api_key}"
|
19
|
-
|
20
|
-
|
20
|
+
http = HTTPClient.new
|
21
|
+
response = http.get(url)
|
22
|
+
parsed_response = parse_response response.body
|
21
23
|
rescue
|
22
24
|
parsed_response = {:status => 500}
|
23
25
|
end
|