class GitCompound::Worker::ConflictingDependencyChecker

Worker that detects conflicting dependencies

Public Class Methods

new() click to toggle source
# File lib/git_compound/worker/conflicting_dependency_checker.rb, line 6
def initialize
  @components = []
end

Public Instance Methods

visit_component(component) click to toggle source
# File lib/git_compound/worker/conflicting_dependency_checker.rb, line 10
def visit_component(component)
  if conflict_exists?(component)
    raise ConflictingDependencyError,
          "Conflicting dependency detected in component `#{component.name}`!"
  end
  @components << component
end

Private Instance Methods

conflict_exists?(component) click to toggle source
# File lib/git_compound/worker/conflicting_dependency_checker.rb, line 20
def conflict_exists?(component)
  @components.any? do |other|
    !(component == other && component.version == other.version) &&
      component.path == other.path
  end
end