X7ROOT File Manager
Current Path:
/opt/alt/ruby26/lib64/ruby/2.6.0/rubygems/resolver
opt
/
alt
/
ruby26
/
lib64
/
ruby
/
2.6.0
/
rubygems
/
resolver
/
ðŸ“
..
📄
activation_request.rb
(3.73 KB)
📄
api_set.rb
(2.46 KB)
📄
api_specification.rb
(2.19 KB)
📄
best_set.rb
(1.61 KB)
📄
composed_set.rb
(1.19 KB)
📄
conflict.rb
(3.35 KB)
📄
current_set.rb
(282 B)
📄
dependency_request.rb
(2.29 KB)
📄
git_set.rb
(2.88 KB)
📄
git_specification.rb
(1.27 KB)
📄
index_set.rb
(1.41 KB)
📄
index_specification.rb
(1.48 KB)
📄
installed_specification.rb
(1.22 KB)
📄
installer_set.rb
(5.02 KB)
📄
local_specification.rb
(807 B)
📄
lock_set.rb
(1.67 KB)
📄
lock_specification.rb
(1.81 KB)
ðŸ“
molinillo
📄
molinillo.rb
(82 B)
📄
requirement_list.rb
(1.34 KB)
📄
set.rb
(1.24 KB)
📄
source_set.rb
(902 B)
📄
spec_specification.rb
(1.06 KB)
📄
specification.rb
(2.33 KB)
📄
stats.rb
(957 B)
📄
vendor_set.rb
(1.91 KB)
📄
vendor_specification.rb
(581 B)
Editing: api_set.rb
# frozen_string_literal: true ## # The global rubygems pool, available via the rubygems.org API. # Returns instances of APISpecification. class Gem::Resolver::APISet < Gem::Resolver::Set ## # The URI for the dependency API this APISet uses. attr_reader :dep_uri # :nodoc: ## # The Gem::Source that gems are fetched from attr_reader :source ## # The corresponding place to fetch gems. attr_reader :uri ## # Creates a new APISet that will retrieve gems from +uri+ using the RubyGems # API URL +dep_uri+ which is described at # http://guides.rubygems.org/rubygems-org-api def initialize(dep_uri = 'https://rubygems.org/api/v1/dependencies') super() dep_uri = URI dep_uri unless URI === dep_uri # for ruby 1.8 @dep_uri = dep_uri @uri = dep_uri + '../..' @data = Hash.new { |h,k| h[k] = [] } @source = Gem::Source.new @uri @to_fetch = [] end ## # Return an array of APISpecification objects matching # DependencyRequest +req+. def find_all(req) res = [] return res unless @remote if @to_fetch.include?(req.name) prefetch_now end versions(req.name).each do |ver| if req.dependency.match? req.name, ver[:number] res << Gem::Resolver::APISpecification.new(self, ver) end end res end ## # A hint run by the resolver to allow the Set to fetch # data for DependencyRequests +reqs+. def prefetch(reqs) return unless @remote names = reqs.map { |r| r.dependency.name } needed = names - @data.keys - @to_fetch @to_fetch += needed end def prefetch_now # :nodoc: needed, @to_fetch = @to_fetch, [] uri = @dep_uri + "?gems=#{needed.sort.join ','}" str = Gem::RemoteFetcher.fetcher.fetch_path uri loaded = [] Marshal.load(str).each do |ver| name = ver[:name] @data[name] << ver loaded << name end (needed - loaded).each do |missing| @data[missing] = [] end end def pretty_print(q) # :nodoc: q.group 2, '[APISet', ']' do q.breakable q.text "URI: #{@dep_uri}" q.breakable q.text 'gem names:' q.pp @data.keys end end ## # Return data for all versions of the gem +name+. def versions(name) # :nodoc: if @data.key?(name) return @data[name] end uri = @dep_uri + "?gems=#{name}" str = Gem::RemoteFetcher.fetcher.fetch_path uri Marshal.load(str).each do |ver| @data[ver[:name]] << ver end @data[name] end end
Upload File
Create Folder