Module: Sup::Differ

Defined in:
lib/sup/differ/differ.rb

Constant Summary collapse

INTERVAL =
300

Class Method Summary collapse

Class Method Details

.restart!Object



26
27
28
# File 'lib/sup/differ/differ.rb', line 26

def restart!
  stop! && start!
end

.runObject



9
10
11
12
13
14
15
16
# File 'lib/sup/differ/differ.rb', line 9

def run
  @projects = Project.all

  loop do
    @projects.map &:diff!
    sleep INTERVAL
  end
end

.start!Object



18
19
20
# File 'lib/sup/differ/differ.rb', line 18

def start!
  `ruby #{File.join(File.expand_path(File.dirname(__FILE__)),'differ_control.rb')} start`
end

.stop!Object



22
23
24
# File 'lib/sup/differ/differ.rb', line 22

def stop!
  `ruby #{File.join(File.expand_path(File.dirname(__FILE__)),'differ_control.rb')} stop`
end