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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab4be27a340d9bc47d778dc61a421e431020a4ab
4
- data.tar.gz: 22c37df713198f6e6a828ba79685978e3447f39a
3
+ metadata.gz: 181f2dce3d65ce29e0924c6e5035057a3e9591df
4
+ data.tar.gz: e142e510ecff3e65392e27c9dbee51c894c5e7a4
5
5
  SHA512:
6
- metadata.gz: 378828ba8f6b5b522b0ab5aba46f6e4dcd15a9e45b31c0a339ea483a83642a3eb2955f7005b4448d090ce244ef3d047992c803f2d745dfb37734712349bf5f07
7
- data.tar.gz: 1ff0ca64d58accc8d26684ecff2c79dd0c38fe73732ea3300be420c39bf5056b46bee16099aff17a89312d4783f0ecc27912a636cde6d2cbe1f68e6d76aae8bb
6
+ metadata.gz: 78f2d14630abd4c3dbf006d67cb149b22773668ea408d2ae7e9c3d4132d7ca8fb1ef314c5281304fb80d00dd65bcc3c57526d770028771b59585158eeb607ea4
7
+ data.tar.gz: 0c5d0b2b22f0ba2ecd11b34659010e63fc86b558673a265edf567241a18f7c29c78c070ee633ff5f33a6fdfbeacb28d17b1a3f25a31142dc866f028fb5b355dd
@@ -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["openocd_config_file_name"])
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
- msg = "Worker could not be found. The workers associated with your Hive are: #{k.join(',')}"
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
@@ -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}).body
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
@@ -1,3 +1,3 @@
1
1
  module Apiotics
2
- VERSION = '0.1.75'
2
+ VERSION = '0.1.76'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apiotics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.75
4
+ version: 0.1.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - MicroArx Corporation