Class: Datagraph::Command::Status

Inherits:
Datagraph::Command show all
Defined in:
lib/datagraph/command/status.rb

Overview

Shows pending, running, and completed processes.

Instance Method Summary (collapse)

Methods inherited from Datagraph::Command

#basename, #parse_repository_specs, #parse_resource_specs, #validate_repository_specs, #validate_resource_specs

Methods included from Datagraph::Client

rpc

Instance Method Details

- execute(process_uuid = nil)

This method returns an undefined value.

Parameters:

  • (String) process_uuid (defaults to: nil)


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/datagraph/command/status.rb', line 9

def execute(process_uuid = nil)
  if process_uuid
    process = Process.new(process_uuid)
    case status = process.status
      when :pending
        puts "The process #{process} is currently pending to run."
      when :running
        puts "The process #{process} is currently running."
      when :aborted
        puts "The process #{process} was aborted."
      when :completed
        puts "The process #{process} has completed."
      else
        puts "The process #{process} has a status of '#{status}'."
    end
  else
    # TODO: show the status for all processes
  end
end