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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4b29e12b29102e085202e3d09a017793326aa2d
4
- data.tar.gz: e9b5fb1045276ed9d21ccb673cfe24c48d43ec4d
3
+ metadata.gz: eabdec7df13573399f5111697cff521e50f654b0
4
+ data.tar.gz: 6b5f6d640fafaa5bea741bd99ed0e89b9a501c45
5
5
  SHA512:
6
- metadata.gz: 772a9bb9b9a1ec612010ae5a6aff015cb9d54d70f05213f09d0e9e09730ed25f446a926946194c1f3993f9e99b604bfa9f369872e32fd87b8b0a88a6239935c5
7
- data.tar.gz: 5dd5f1e0660c5d7190faf67dd291d07f95fb610364b24c0c2b161999f43aaf21108e3a1e57d113c84a7923305a7efd629804689f470f43dc754540a63019c550
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 { |e| no(e) }
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 no(error)
28
- raise FetchError, "Error fetching #{self.class.to_s}: #{error.message}"
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.2
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-16 00:00:00.000000000 Z
11
+ date: 2015-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler