apiotics 0.1.75 → 0.1.76
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/lib/apiotics/hardware.rb +3 -3
- data/lib/apiotics/portal.rb +5 -1
- data/lib/apiotics/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 181f2dce3d65ce29e0924c6e5035057a3e9591df
|
4
|
+
data.tar.gz: e142e510ecff3e65392e27c9dbee51c894c5e7a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78f2d14630abd4c3dbf006d67cb149b22773668ea408d2ae7e9c3d4132d7ca8fb1ef314c5281304fb80d00dd65bcc3c57526d770028771b59585158eeb607ea4
|
7
|
+
data.tar.gz: 0c5d0b2b22f0ba2ecd11b34659010e63fc86b558673a265edf567241a18f7c29c78c070ee633ff5f33a6fdfbeacb28d17b1a3f25a31142dc866f028fb5b355dd
|
data/lib/apiotics/hardware.rb
CHANGED
@@ -84,12 +84,12 @@ module Apiotics
|
|
84
84
|
config = Apiotics::Portal.openocd_worker_config(worker_name)
|
85
85
|
config = JSON.parse(config)
|
86
86
|
unless config["openocd_config_file_name"] == nil || config["openocd_config_file_name"] == ""
|
87
|
-
path = Rails.root.join('lib', 'openocd', 'downloads', config["
|
87
|
+
path = Rails.root.join('lib', 'openocd', 'downloads', config["firmware_file_name"])
|
88
88
|
if File.exist?(path)
|
89
89
|
else
|
90
90
|
firmware_data = Apiotics::Portal.download_firmware(worker_name)
|
91
91
|
file = File.new(path, 'w')
|
92
|
-
file.write firmware_data.force_encoding(Encoding::UTF_8)
|
92
|
+
file.write firmware_data["file"].force_encoding(Encoding::UTF_8)
|
93
93
|
file.close
|
94
94
|
end
|
95
95
|
clean_string = "1" * 68 * 8
|
@@ -117,7 +117,7 @@ module Apiotics
|
|
117
117
|
msg = self.install_firmware(config["openocd_config_file_name"], path, config["openocd_start_address"])
|
118
118
|
else
|
119
119
|
k = Apiotics.configuration.targets.keys
|
120
|
-
|
120
|
+
puts "Worker could not be found. The workers associated with your Hive are: #{k.join(',')}"
|
121
121
|
end
|
122
122
|
return msg
|
123
123
|
end
|
data/lib/apiotics/portal.rb
CHANGED
@@ -248,7 +248,11 @@ module Apiotics
|
|
248
248
|
end
|
249
249
|
|
250
250
|
def self.download_firmware(worker_name)
|
251
|
-
response = HTTParty.post("#{Apiotics.configuration.portal}api/download", :query => {:public_key => Apiotics.configuration.public_key, :private_key => Apiotics.configuration.private_key, :worker => worker_name})
|
251
|
+
response = HTTParty.post("#{Apiotics.configuration.portal}api/download", :query => {:public_key => Apiotics.configuration.public_key, :private_key => Apiotics.configuration.private_key, :worker => worker_name})
|
252
|
+
data = {
|
253
|
+
"file_name" => response.headers["content-disposition"].split[1].split("\"")[1],
|
254
|
+
"file" => response.body
|
255
|
+
}
|
252
256
|
end
|
253
257
|
|
254
258
|
end
|
data/lib/apiotics/version.rb
CHANGED