The RequirementList is used to hold the requirements being considered while resolving a set of gems.
The RequirementList acts like a queue where the oldest items are removed first.
Methods
Included Modules
Class Public methods
new()
Link
Creates a new RequirementList.
Source: show
# File lib/rubygems/resolver/requirement_list.rb, line 15 def initialize @exact = [] @list = [] end
Instance Public methods
add(req)
Link
Adds Resolver::DependencyRequest req to this requirements
list.
Source: show
# File lib/rubygems/resolver/requirement_list.rb, line 28 def add(req) if req.requirement.exact? @exact.push req else @list.push req end req end
empty?()
Link
Is the list empty?
Source: show
# File lib/rubygems/resolver/requirement_list.rb, line 62 def empty? @exact.empty? && @list.empty? end
next5()
Link
Returns the oldest five entries from the list.
Source: show
# File lib/rubygems/resolver/requirement_list.rb, line 77 def next5 x = @exact[0,5] x + @list[0,5 - x.size] end