Class: Tracker::Deliverer
- Inherits:
-
Object
- Object
- Tracker::Deliverer
- Defined in:
- lib/pivotal-git-tracker/deliverer.rb
Instance Attribute Summary collapse
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #find_and_comment(branch = nil, server_name = nil, version = nil) ⇒ Object
-
#initialize(project, git) ⇒ Deliverer
constructor
A new instance of Deliverer.
- #mark_as_delivered(branch = nil, server_name = nil) ⇒ Object
Constructor Details
#initialize(project, git) ⇒ Deliverer
Returns a new instance of Deliverer.
4 5 6 7 |
# File 'lib/pivotal-git-tracker/deliverer.rb', line 4 def initialize(project, git) @project = project @git = git end |
Instance Attribute Details
#git ⇒ Object (readonly)
Returns the value of attribute git.
3 4 5 |
# File 'lib/pivotal-git-tracker/deliverer.rb', line 3 def git @git end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
3 4 5 |
# File 'lib/pivotal-git-tracker/deliverer.rb', line 3 def project @project end |
Instance Method Details
#find_and_comment(branch = nil, server_name = nil, version = nil) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/pivotal-git-tracker/deliverer.rb', line 25 def find_and_comment(branch = nil, server_name = nil, version = nil) = {} [:branch] = branch if branch for story_id in git.latest_log() story = project.find(story_id) if story puts "Found story with id #{story_id} on server #{server_name}" project.comment(story, server_name) project.add_label(story, version) if version end end end |
#mark_as_delivered(branch = nil, server_name = nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/pivotal-git-tracker/deliverer.rb', line 9 def mark_as_delivered(branch = nil, server_name = nil) = {} [:branch] = branch if branch collection = project.finished collection.each do |story| puts "Found finished story in Pivotal with id #{story.id}" if git.contains?(story.id, ) puts "Delivering story with id #{story.id} on server #{server_name}" project.deliver(story) project.comment(story, server_name) if server_name end end end |