Class: Tracker::Deliverer

Inherits:
Object
  • Object
show all
Defined in:
lib/tracker-git/deliverer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project, git) ⇒ Deliverer

Returns a new instance of Deliverer.



4
5
6
7
# File 'lib/tracker-git/deliverer.rb', line 4

def initialize(project, git)
  @project = project
  @git = git
end

Instance Attribute Details

#gitObject (readonly)

Returns the value of attribute git.



3
4
5
# File 'lib/tracker-git/deliverer.rb', line 3

def git
  @git
end

#projectObject (readonly)

Returns the value of attribute project.



3
4
5
# File 'lib/tracker-git/deliverer.rb', line 3

def project
  @project
end

Instance Method Details

#mark_as_delivered(branch = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/tracker-git/deliverer.rb', line 9

def mark_as_delivered(branch = nil)
  options = {}
  options[:branch] = branch if branch

  project.finished.each do |story|
    if git.contains?(story.id, options)
      project.deliver(story)
    end
  end
end