Class: GitCompound::Worker::ComponentUpdater
- Defined in:
- lib/git_compound/worker/component_updater.rb
Overview
Worker that updates component
Instance Method Summary collapse
-
#initialize(lock) ⇒ ComponentUpdater
constructor
A new instance of ComponentUpdater.
- #visit_component(component) ⇒ Object
Methods inherited from Worker
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 |