Class: FlashFlow::IssueTracker::Pivotal
- Inherits:
-
Object
- Object
- FlashFlow::IssueTracker::Pivotal
- Includes:
- TimeHelper
- Defined in:
- lib/flash_flow/issue_tracker/pivotal.rb
Instance Method Summary collapse
-
#initialize(branches, git, opts = {}) ⇒ Pivotal
constructor
A new instance of Pivotal.
- #production_deploy ⇒ Object
- #release_notes(hours, file = STDOUT) ⇒ Object
- #stories_delivered ⇒ Object
- #stories_pushed ⇒ Object
Methods included from TimeHelper
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_deploy ⇒ Object
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_delivered ⇒ Object
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_pushed ⇒ Object
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 |