Class: FlashFlow::IssueTracker::Pivotal

Inherits:
Object
  • Object
show all
Includes:
TimeHelper
Defined in:
lib/flash_flow/issue_tracker/pivotal.rb

Instance Method Summary collapse

Methods included from TimeHelper

#with_time_zone

Constructor Details

#initialize(branches, git, opts = {}) ⇒ Pivotal

Returns a new instance of Pivotal.



10
11
12
13
14
15
16
17
18
# File 'lib/flash_flow/issue_tracker/pivotal.rb', line 10

def initialize(branches, git, opts={})
  @branches = branches
  @git = git
  @timezone = opts['timezone'] || "UTC"

  PivotalTracker::Client.token = opts['token']
  PivotalTracker::Client.use_ssl = true
  @project = PivotalTracker::Project.find(opts['project_id'])
end

Instance Method Details

#production_deployObject



41
42
43
44
45
46
47
# File 'lib/flash_flow/issue_tracker/pivotal.rb', line 41

def production_deploy
  shipped_branches.each do |branch|
    branch.stories.to_a.each do |story_id|
      comment(story_id)
    end
  end
end

#release_notes(hours, file = STDOUT) ⇒ Object



49
50
51
52
53
54
55
56
57
# File 'lib/flash_flow/issue_tracker/pivotal.rb', line 49

def release_notes(hours, file=STDOUT)
  release_stories = done_and_current_stories.map do |story|
    shipped_text = has_shipped_text?(story)
    format_release_data(story.id, story.name, shipped_text) if shipped_text
  end.compact

  release_notes = release_by(release_stories, hours)
  print_release_notes(release_notes, file)
end

#stories_deliveredObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/flash_flow/issue_tracker/pivotal.rb', line 28

def stories_delivered
  merged_branches.each do |branch|
    branch.stories.to_a.each do |story_id|
      deliver(story_id)
    end
  end
  removed_branches.each do |branch|
    branch.stories.to_a.each do |story_id|
      undeliver(story_id)
    end
  end
end

#stories_pushedObject



20
21
22
23
24
25
26
# File 'lib/flash_flow/issue_tracker/pivotal.rb', line 20

def stories_pushed
  if merged_working_branch
    merged_working_branch.stories.to_a.each do |story_id|
      finish(story_id)
    end
  end
end