| Server IP : 162.214.74.102 / Your IP : 216.73.217.80 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/rubygems/rubygems/ |
Upload File : |
require 'rubygems/source'
class Gem::SourceList
def initialize
@sources = []
end
attr_reader :sources
def self.from(ary)
list = new
if ary
ary.each do |x|
list << x
end
end
return list
end
def initialize_copy(other)
@sources = @sources.dup
end
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 replace(other)
@sources.clear
other.each do |x|
self << x
end
self
end
def each
@sources.each { |s| yield s.uri.to_s }
end
def each_source(&b)
@sources.each(&b)
end
def ==(other)
to_a == other
end
def to_a
@sources.map { |x| x.uri.to_s }
end
alias_method :to_ary, :to_a
def first
@sources.first
end
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 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
end