public
Description: CruiseControl.rb is a continuous integration tool, written in Ruby. It is quick to install, simple to use and easy to hack.
Homepage: http://cruisecontrolrb.thoughtworks.com/
Clone URL: git://github.com/benburkert/cruisecontrolrb.git
cruisecontrolrb / app / models / change_in_source_control_trigger.rb
100644 18 lines (16 sloc) 0.466 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class ChangeInSourceControlTrigger
  def initialize(triggered_project)
    @triggered_project = triggered_project
  end
 
  def build_necessary?(reasons)
    p = @triggered_project
    p.notify :polling_source_control
    if !p.source_control.up_to_date?(reasons)
      p.notify :new_revisions_detected, reasons.flatten.find_all{|reason| reason.is_a? Revision}
      return true
    else
      p.notify :no_new_revisions_detected
      return false
    end
  end
end