Class: Helm::Commands::Show

Inherits:
Command
  • Object
show all
Defined in:
lib/helm/commands/show.rb

Instance Attribute Summary

Attributes inherited from Command

#session

Instance Method Summary collapse

Methods inherited from Command

#cache, #format, #initialize, #parameters

Constructor Details

This class inherits a constructor from Helm::Commands::Command

Instance Method Details

#runObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/helm/commands/show.rb', line 4

def run
  parameters :milestone, :filter

  unless milestone = session.milestone
    return puts("The milestone \"#{session[:milestone]}\" couldn't be found")
  end

  filter = session[:filter] || "state:open milestone:\"#{milestone.title}\""

  puts "Details about #{milestone.title}"
  puts "  Goals:   #{milestone.goals}"
  puts "  Due on:  #{milestone.due_on}"
  puts ""
  puts "  Tickets (#{milestone.open_tickets_count} open out of #{milestone.tickets_count})"

  session.tickets(filter).each do |ticket|
    puts "  ##{ticket.id} #{ticket.title}"
  end
end