Class: GradesFirst::TaskListCommand

Inherits:
TaskCommand show all
Defined in:
lib/gradesfirst/task_list_command.rb

Overview

Implementation of a Thor command for listing tasks related to a story.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionObject

Description of the gf task list Thor command that will be used in the command line help.



10
11
12
# File 'lib/gradesfirst/task_list_command.rb', line 10

def self.description
  'List the tasks related to a PivotalTracker story.'
end

Instance Method Details

#executeObject

Performs the gf task list Thor command.



15
16
17
18
19
20
# File 'lib/gradesfirst/task_list_command.rb', line 15

def execute
  @story = current_story
  if @story
    @tasks = get_tasks(@story)
  end
end

#responseObject

Generates the comand line output response. The output of the task command is a list of the tasks associated with the PivotalTracker story associated with the current branch.



25
26
27
28
29
30
31
# File 'lib/gradesfirst/task_list_command.rb', line 25

def response
  if @tasks.nil?
    story_error_message
  else
    task_list_response(@story, @tasks)
  end
end