aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/resolver/requirement_list.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-25 19:14:49 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-25 19:14:49 +0000
commit04817ae6d3e1d898d6fbf09ad146850d26d2b404 (patch)
tree7e5482d13830cacf363d21a087b490588a960095 /lib/rubygems/resolver/requirement_list.rb
parentc107372597586e1ad0fea03c00a14bdd7205b5d8 (diff)
downloadruby-04817ae6d3e1d898d6fbf09ad146850d26d2b404.tar.gz
* 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
Diffstat (limited to 'lib/rubygems/resolver/requirement_list.rb')
-rw-r--r--lib/rubygems/resolver/requirement_list.rb24
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/rubygems/resolver/requirement_list.rb b/lib/rubygems/resolver/requirement_list.rb
index 04e437b2a9..fe1d77afc3 100644
--- a/lib/rubygems/resolver/requirement_list.rb
+++ b/lib/rubygems/resolver/requirement_list.rb
@@ -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