Combines sets into a ComposedSet that allows
specification lookup in a uniform manner. If one of the sets is
itself a ComposedSet its sets
are flattened into the result ComposedSet.
# File lib/rubygems/resolver.rb, line 57
def self.compose_sets *sets
sets.compact!
sets = sets.map do |set|
case set
when Gem::Resolver::BestSet then
set
when Gem::Resolver::ComposedSet then
set.sets
else
set
end
end.flatten
case sets.length
when 0 then
raise ArgumentError, 'one set in the composition must be non-nil'
when 1 then
sets.first
else
Gem::Resolver::ComposedSet.new(*sets)
end
end