Module: Chicanery::Repos

Includes:
Collections, Handlers
Included in:
Chicanery
Defined in:
lib/chicanery/repos.rb

Instance Method Summary collapse

Methods included from Debug

#verbose, #verbose_blue

Instance Method Details

#check_repos(current_state, previous_state) ⇒ Object



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

def check_repos current_state, previous_state
  current_state[:repos] = {}
  repos.each do |repo|
    repo_state = repo.state
    compare_repo_state repo.name, repo_state, previous_state[:repos][repo.name] if previous_state[:repos]
    current_state[:repos][repo.name] = repo_state
  end
end

#compare_repo_state(name, current, previous) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/chicanery/repos.rb', line 18

def compare_repo_state name, current, previous
  return unless previous
  current.each do |branch, state|
    next unless previous[branch]
    notify_commit_handlers "#{name}/#{branch}", state, previous[branch] if state != previous[branch]
  end
end