Class: Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/pivotcli/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Runner

Returns a new instance of Runner.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/pivotcli/runner.rb', line 7

def initialize(options)
  @project_name = options[:project]
  @owner = options[:owner]
  @state = options[:state]
  @token = options[:token]
  @show_desc = options[:show_descriptions]
  @story_type = options[:story_type]

  if @token.nil?
    load_config
  end

  @pt_client = PivotalTracker::Client.token = @token
  @pt_client = PivotalTracker::Client.use_ssl = @ssl

  @projects = PivotalTracker::Project.all

  @projects.each do |prj|
    if prj.name.downcase.eql? @project_name.downcase
      @prj_id = prj.id
    end
  end

  @project = PivotalTracker::Project.find(@prj_id)

end

Instance Method Details

#get_storiesObject



34
35
36
37
38
39
# File 'lib/pivotcli/runner.rb', line 34

def get_stories
  @project.stories.all(:current_state => @state, :owned_by => @owner).each do |story|
    puts "#{story.id.to_s.red} | #{story.name}"
    puts "\t#{story.description.cyan}" unless @show_desc.nil? or story.description.empty?
  end
end