Module: Bixby::Repository

Extended by:
Log
Defined in:
lib/bixby-client/modules/repository.rb

Class Method Summary collapse

Class Method Details

.fetch_file(cmd, file, dest) ⇒ Object

Download the given command file

Parameters:

  • cmd (CommandSpec)

    CommandSpec representing the Bundle to which the files belong

  • files (Hash)

    Hash, returned from #list_files



27
28
29
30
31
32
# File 'lib/bixby-client/modules/repository.rb', line 27

def self.fetch_file(cmd, file, dest)
  params = cmd.to_hash
  params.delete(:digest)
  req = JsonRequest.new("provisioning:fetch_file", [params, file])
  Bixby.client.exec_api_download(req, dest)
end

.list_files(cmd) ⇒ Array<Hash>

Retrieve a file listing for the given Bundle

Parameters:

  • cmd (CommandSpec)

    CommandSpec representing the Bundle to list

Returns:

  • (Array<Hash>)
    • file [String] Relative path of file

    • digest [String] SHA256 digest of file



16
17
18
19
20
21
# File 'lib/bixby-client/modules/repository.rb', line 16

def self.list_files(cmd)
  debug { "listing files for bundle: #{cmd.bundle}"}
  req = JsonRequest.new("provisioning:list_files", cmd.to_hash)
  res = Bixby.client.exec_api(req)
  return res.data
end