class Gem::SourceList

def self.from(ary)

def self.from(ary)
  list = new
  if ary
    ary.each do |x|
      list << x
    end
  end
  return list
end

def <<(obj)

def <<(obj)
  src = case obj
        when URI
          Gem::Source.new(obj)
        when Gem::Source
          obj
        else
          Gem::Source.new(URI.parse(obj))
        end
  @sources << src
  src
end

def ==(other)

def ==(other)
  to_a == other
end

def delete(uri)

def delete(uri)
  if uri.kind_of? Gem::Source
    @sources.delete uri
  else
    @sources.delete_if { |x| x.uri.to_s == uri.to_s }
  end
end

def each

def each
  @sources.each { |s| yield s.uri.to_s }
end

def each_source(&b)

def each_source(&b)
  @sources.each(&b)
end

def first

def first
  @sources.first
end

def include?(other)

def include?(other)
  if other.kind_of? Gem::Source
    @sources.include? other
  else
    @sources.find { |x| x.uri.to_s == other.to_s }
  end
end

def initialize

def initialize
  @sources = []
end

def initialize_copy(other)

def initialize_copy(other)
  @sources = @sources.dup
end

def replace(other)

def replace(other)
  @sources.clear
  other.each do |x|
    self << x
  end
  self
end

def to_a

def to_a
  @sources.map { |x| x.uri.to_s }
end