mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems: Update to RubyGems master 612f85a. Notable changes:
Fixed installation and activation of git: and path: gems via Gem.use_gemdeps Improved documentation coverage * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c107372597
commit
04817ae6d3
38 changed files with 587 additions and 88 deletions
|
@ -1,19 +1,28 @@
|
|||
##
|
||||
# Used internally to hold the requirements being considered
|
||||
# while attempting to find a proper activation set.
|
||||
# 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.
|
||||
|
||||
class Gem::Resolver::RequirementList
|
||||
|
||||
include Enumerable
|
||||
|
||||
##
|
||||
# Creates a new RequirementList.
|
||||
|
||||
def initialize
|
||||
@list = []
|
||||
end
|
||||
|
||||
def initialize_copy(other)
|
||||
def initialize_copy other # :nodoc:
|
||||
@list = @list.dup
|
||||
end
|
||||
|
||||
##
|
||||
# Adds Resolver::DependencyRequest +req+ to this requirements list.
|
||||
|
||||
def add(req)
|
||||
@list.push req
|
||||
req
|
||||
|
@ -30,14 +39,23 @@ class Gem::Resolver::RequirementList
|
|||
end
|
||||
end
|
||||
|
||||
##
|
||||
# Is the list empty?
|
||||
|
||||
def empty?
|
||||
@list.empty?
|
||||
end
|
||||
|
||||
##
|
||||
# Remove the oldest DependencyRequest from the list.
|
||||
|
||||
def remove
|
||||
@list.shift
|
||||
end
|
||||
|
||||
##
|
||||
# Returns the oldest five entries from the list.
|
||||
|
||||
def next5
|
||||
@list[0,5]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue