Class: GitCompound::Worker::NameConstraintChecker

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

Overview

Worker that detects if component name and its manifest name matches This is important because it is additional verification of consistency of manifests

Instance Method Summary collapse

Methods inherited from Worker

#visit_manifest, #visit_task

Instance Method Details

#visit_component(component) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/git_compound/worker/name_constraint_checker.rb', line 8

def visit_component(component)
  return unless component.manifest.exists?

  component_name = component.name
  manifest_name  = component.manifest.name

  return if component_name == manifest_name
  raise NameConstraintError, "Name of component `#{component_name}` " \
    "does not match name in its manifest (`#{manifest_name}`) !"
end