farmbot-resource 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +0 -2
- data/lib/client.rb +6 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 260a098d3d3a67d135108ca2a9a1179ae60e9798
|
4
|
+
data.tar.gz: 3d7c3505e9af3af0283075e5044fe0a8a378129b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee68a0e3020cdfa857dfe93e9fe88712a5cc87aee8fc76f9fda6c1fcc10711f2580c149a44561b880c0da3596ec9455a599d73a0d3a0ae108f425c92fff1051b
|
7
|
+
data.tar.gz: 595bc5add1ad06a4515bfabc37665771ba667fdba1809e32cc746fac90529d4c229d0bbd37711bc103c35969b67207fd177a54cfb9abed2e0a0ac203bd1c4ac1
|
data/Gemfile
CHANGED
data/lib/client.rb
CHANGED
@@ -32,8 +32,12 @@ module FbResource
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def self.public_key(url = "my.farmbot.io")
|
35
|
-
|
36
|
-
|
35
|
+
wow = Http.get(url + "/api/public_key", {})
|
36
|
+
if wow.response.code.to_i < 400
|
37
|
+
return OpenSSL::PKey::RSA.new(wow.body)
|
38
|
+
else
|
39
|
+
raise "Unable to fetch public key. Is the server down?"
|
40
|
+
end
|
37
41
|
end
|
38
42
|
|
39
43
|
def device
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: farmbot-resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Carlino
|
@@ -148,3 +148,4 @@ specification_version: 4
|
|
148
148
|
summary: Ruby Gem to access resources on Farmbot Web App
|
149
149
|
test_files:
|
150
150
|
- spec/spec_helper.rb
|
151
|
+
has_rdoc:
|