Class: GitCompound::Worker::LocalChangesGuard

Inherits:
Worker
  • Object
show all
Defined in:
lib/git_compound/worker/local_changes_guard.rb

Overview

Worker that defends local changes in component repositories

Instance Method Summary collapse

Methods inherited from Worker

#visit_manifest, #visit_task

Constructor Details

#initialize(lock) ⇒ LocalChangesGuard

Returns a new instance of LocalChangesGuard.



7
8
9
# File 'lib/git_compound/worker/local_changes_guard.rb', line 7

def initialize(lock)
  @lock = lock
end

Instance Method Details

#visit_component(component) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/git_compound/worker/local_changes_guard.rb', line 11

def visit_component(component)
  return unless component.exists?

  @component  = component
  @repository = component.repository

  check_uncommited_changes!
  check_untracked_files!
end