class Gem::AvailableSet
Constants
- Tuple
Attributes
Public Class Methods
Source
# File lib/rubygems/available_set.rb, line 10definitialize@set = []@sorted =nil@remote =trueend
Public Instance Methods
Source
# File lib/rubygems/available_set.rb, line 24def<<(o)caseowhenGem::AvailableSets =o.setwhenArrays =o.mapdo|sp,so|if!sp.is_a?(Gem::Specification)||!so.is_a?(Gem::Source)raiseTypeError,"Array must be in [[spec, source], ...] form"endTuple.new(sp,so)endelseraiseTypeError,"must be a Gem::AvailableSet"end@set+=s@sorted =nilselfend
Source
# File lib/rubygems/available_set.rb, line 18defadd(spec,source)@set<<Tuple.new(spec,source)@sorted =nilselfend
Source
# File lib/rubygems/available_set.rb, line 49defeachreturnenum_for__method__unlessblock_given?@set.eachdo|tuple|yieldtupleendend
Yields eachTuple in thisAvailableSet
Source
# File lib/rubygems/available_set.rb, line 60defeach_specreturnenum_for__method__unlessblock_given?eachdo|tuple|yieldtuple.specendend
Yields theGem::Specification for eachTuple in thisAvailableSet
Source
# File lib/rubygems/available_set.rb, line 126deffind_all(req)dep =req.dependencymatch =@set.find_alldo|t|dep.match?t.specendmatch.mapdo|t|Gem::Resolver::LocalSpecification.new(self,t.spec,t.source)endend
Used by the Resolver, the protocol to use aAvailableSet as a search Set.
Source
# File lib/rubygems/available_set.rb, line 162definject_into_list(dep_list)@set.each {|t|dep_list.addt.spec }end
Source
# File lib/rubygems/available_set.rb, line 76defmatch_platform!@set.reject! {|t|!Gem::Platform.match_spec?(t.spec) }@sorted =nilselfend
Source
# File lib/rubygems/available_set.rb, line 141defpick_best!returnselfifempty?@set = [sorted.first]@sorted =nilselfend
Source
# File lib/rubygems/available_set.rb, line 149defremove_installed!(dep)@set.reject!do|_t|# already locally installedGem::Specification.any?do|installed_spec|dep.name==installed_spec.name&&dep.requirement.satisfied_by?(installed_spec.version)endend@sorted =nilselfend
Source
# File lib/rubygems/available_set.rb, line 82defsorted@sorted||=@set.sortdo|a,b|i =b.spec<=>a.speci!=0?i: (a.source<=>b.source)endend
Source
# File lib/rubygems/available_set.rb, line 93defsource_for(spec)f =@set.find {|t|t.spec==spec }f.sourceend
Source
# File lib/rubygems/available_set.rb, line 106defto_request_set(development =:none)request_set =Gem::RequestSet.newrequest_set.development =development==:alleach_specdo|spec|request_set.always_install<<specrequest_set.gemspec.name,spec.versionrequest_set.importspec.development_dependenciesifdevelopment==:shallowendrequest_setend
Converts thisAvailableSet into a RequestSet that can be used to install gems.
Ifdevelopment is :none then no development dependencies are installed. Other options are :shallow for only direct development dependencies of the gems in this set or :all for all development dependencies.