Sha256: 892d30dae883ddebada23d833051663dacbe9cc7b63229d272d3cc30ee83746f

Contents?: true

Size: 639 Bytes

Versions: 4

Compression:

Stored size: 639 Bytes

Contents

require 'appraisal/dependency'
require "set"

module Appraisal
  class DependencyList
    def initialize
      @dependencies = Hash.new
      @removed_dependencies = Set.new
    end

    def add(name, requirements)
      unless @removed_dependencies.include?(name)
        @dependencies[name] = Dependency.new(name, requirements)
      end
    end

    def remove(name)
      if @removed_dependencies.add?(name)
        @dependencies.delete(name)
      end
    end

    def to_s
      @dependencies.values.map(&:to_s).join("\n")
    end

    # :nodoc:
    def for_dup
      @dependencies.values.map(&:for_dup).join("\n")
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/appraisal-2.5.0/lib/appraisal/dependency_list.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/appraisal-2.5.0/lib/appraisal/dependency_list.rb
appraisal-2.5.0 lib/appraisal/dependency_list.rb
appraisal-2.4.1 lib/appraisal/dependency_list.rb