class ReaPack::Index::ConflictDetector::Selector

Public Class Methods

new(key, cdetector) click to toggle source
# File lib/reapack/index/cdetector.rb, line 6
def initialize(key, cdetector)
  @key, @cdetector = key, cdetector
end

Public Instance Methods

clear() click to toggle source
# File lib/reapack/index/cdetector.rb, line 14
def clear
  @cdetector.buckets.each_value do |b|
    b.reject! {|e| e.key == @key }
  end
end
push(bucket, platform, file) click to toggle source
# File lib/reapack/index/cdetector.rb, line 10
def push(bucket, platform, file)
  @cdetector.bucket(bucket) << Entry.new(@key, platform, file).freeze
end
resolve() click to toggle source
# File lib/reapack/index/cdetector.rb, line 20
def resolve
  errors = @cdetector.buckets.map do |b, _|
    @cdetector.resolve b, @key
  end.compact.flatten

  errors unless errors.empty?
end