farmbot-resource 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resources/abstract_resource.rb +8 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eabdec7df13573399f5111697cff521e50f654b0
|
4
|
+
data.tar.gz: 6b5f6d640fafaa5bea741bd99ed0e89b9a501c45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a6ec6dd331eb91c97f4bb41daae2eedfca43b1824c265f469cb088a25ac43957193d0963af76deac9b25777bf76510a6ab7bfdd14440b4d7587fb0e95e8a962
|
7
|
+
data.tar.gz: db3453fbae7bd1f6713b8d464fee5611a06abeb5663cf8db2084dfddd9235088d5af6c6b06ed91afbdf5945d0571128c4febd945b515f3d35577d444cd995235
|
@@ -20,12 +20,17 @@ module FbResource
|
|
20
20
|
def fetch
|
21
21
|
Http
|
22
22
|
.get(conf.url + self.class.path, conf.creds)
|
23
|
-
.no { |
|
23
|
+
.no { |obj, req, res| fetch_no(obj, req, res) }
|
24
24
|
.ok { |obj, req, res| fetch_ok(obj, req, res) }
|
25
25
|
end
|
26
26
|
|
27
|
-
def
|
28
|
-
raise FetchError, "
|
27
|
+
def fetch_no(obj, req, res)
|
28
|
+
raise FetchError, """
|
29
|
+
Error Fetching Farmbot resource:
|
30
|
+
#{obj || "\n"}
|
31
|
+
#{req.try(:url)}
|
32
|
+
#{res.try(:message)}
|
33
|
+
#{res.class}""".squeeze
|
29
34
|
end
|
30
35
|
|
31
36
|
def fetch_ok(obj, request, response)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: farmbot-resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Carlino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|