Class: HmxClient::Command::Task

Inherits:
Base
  • Object
show all
Defined in:
lib/hmx/command/task.rb

Overview

Display and manage tasks in hmx

Constant Summary

Constants inherited from Base

Base::FILE

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Methods inherited from Base

#hmx, #initialize, #loadConfig!, namespace, #removeConfig, #storeConfig, #writeConfig

Methods included from Helpers

#display, #display_row, #display_tab, #display_table, #error, #getFromUser, #longest

Constructor Details

This class inherits a constructor from HmxClient::Command::Base

Instance Method Details

#indexObject

task

List all of the tasks



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/hmx/command/task.rb', line 13

def index
  tasks = hmx.doGetAllTasks([])
  objs = []
  tasks.each do | t | 
      task = hmx.doGetTask([t])
      objs << task
  end
  headers = [ "TaskId", "TaskType", "TaskState", "GroupId" ]
  cols = [ "taskId", "taskType", "taskState", "group" ] 
  display_table(objs, cols, headers)
end

#purgeObject

task:purge

Purge completed tasks



27
28
29
30
# File 'lib/hmx/command/task.rb', line 27

def purge
  hmx.doPurgeTasks([])
  display "Purge complete"
end