Class: GitCompound::Worker::ComponentUpdater

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

Overview

Worker that updates component

Instance Method Summary collapse

Methods inherited from Worker

#visit_manifest, #visit_task

Constructor Details

#initialize(lock) ⇒ ComponentUpdater

Returns a new instance of ComponentUpdater.



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

def initialize(lock)
  @lock    = lock
  @print   = PrettyPrint.new
end

Instance Method Details

#visit_component(component) ⇒ Object



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

def visit_component(component)
  raise "Component `#{component.name}` is not built !" unless
    component.exists?

  Logger.inline 'Updating:  '
  @print.visit_component(component)

  component.update!

  @lock.lock_component(component)
end