SILENT KILLERPanel

Current Path: > > opt > alt > > ruby34 > share > rubygems > rubygems


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/alt//ruby34/share/rubygems/rubygems

NameTypeSizeLast ModifiedActions
commands Directory - -
core_ext Directory - -
defaults Directory - -
ext Directory - -
gemcutter_utilities Directory - -
package Directory - -
request Directory - -
request_set Directory - -
resolver Directory - -
safe_marshal Directory - -
security Directory - -
source Directory - -
ssl_certs Directory - -
util Directory - -
vendor Directory - -
available_set.rb File 3075 bytes May 29 2025 13:39:48.
basic_specification.rb File 8329 bytes May 29 2025 13:39:49.
bundler_version_finder.rb File 2009 bytes May 29 2025 13:39:49.
ci_detector.rb File 3801 bytes May 29 2025 13:39:48.
command.rb File 16179 bytes May 29 2025 13:39:49.
command_manager.rb File 5778 bytes May 29 2025 13:39:49.
compatibility.rb File 1022 bytes May 29 2025 13:39:48.
config_file.rb File 16700 bytes May 29 2025 13:39:49.
defaults.rb File 7558 bytes May 29 2025 13:39:49.
dependency.rb File 8652 bytes May 29 2025 13:39:49.
dependency_installer.rb File 10144 bytes May 29 2025 13:39:49.
dependency_list.rb File 5684 bytes May 29 2025 13:39:49.
deprecate.rb File 5159 bytes May 29 2025 13:39:49.
doctor.rb File 3204 bytes May 29 2025 13:39:48.
errors.rb File 4635 bytes May 29 2025 13:39:48.
exceptions.rb File 7298 bytes May 29 2025 13:39:49.
ext.rb File 498 bytes May 29 2025 13:39:49.
gem_runner.rb File 2187 bytes May 29 2025 13:39:49.
gemcutter_utilities.rb File 11515 bytes May 29 2025 13:39:48.
gemspec_helpers.rb File 394 bytes May 29 2025 13:39:49.
install_default_message.rb File 349 bytes May 29 2025 13:39:49.
install_message.rb File 323 bytes May 29 2025 13:39:49.
install_update_options.rb File 6722 bytes May 29 2025 13:39:48.
installer.rb File 28403 bytes May 29 2025 13:39:49.
installer_uninstaller_utils.rb File 771 bytes May 29 2025 13:39:48.
local_remote_options.rb File 3675 bytes May 29 2025 13:39:48.
name_tuple.rb File 2442 bytes May 29 2025 13:39:49.
openssl.rb File 125 bytes May 29 2025 13:39:49.
package.rb File 19281 bytes May 29 2025 13:39:48.
package_task.rb File 3879 bytes May 29 2025 13:39:48.
path_support.rb File 1816 bytes May 29 2025 13:39:49.
platform.rb File 8608 bytes May 29 2025 13:39:49.
psych_tree.rb File 855 bytes May 29 2025 13:39:49.
query_utils.rb File 8703 bytes May 29 2025 13:39:48.
rdoc.rb File 660 bytes May 29 2025 13:39:49.
remote_fetcher.rb File 9604 bytes May 29 2025 13:39:48.
request.rb File 8910 bytes May 29 2025 13:39:49.
request_set.rb File 11558 bytes May 29 2025 13:39:49.
requirement.rb File 7298 bytes May 29 2025 13:39:48.
resolver.rb File 9659 bytes May 29 2025 13:39:49.
s3_uri_signer.rb File 6106 bytes May 29 2025 13:39:49.
safe_marshal.rb File 1969 bytes May 29 2025 13:39:49.
safe_yaml.rb File 1067 bytes May 29 2025 13:39:49.
security.rb File 22214 bytes May 29 2025 13:39:49.
security_option.rb File 1084 bytes May 29 2025 13:39:49.
shellwords.rb File 66 bytes May 29 2025 13:39:49.
source.rb File 5922 bytes May 29 2025 13:39:49.
source_list.rb File 2482 bytes May 29 2025 13:39:49.
spec_fetcher.rb File 7868 bytes May 29 2025 13:39:49.
specification.rb File 70688 bytes May 29 2025 13:39:49.
specification_policy.rb File 15964 bytes May 29 2025 13:39:48.
specification_record.rb File 5332 bytes May 29 2025 13:39:48.
stub_specification.rb File 5078 bytes May 29 2025 13:39:48.
target_rbconfig.rb File 1273 bytes May 29 2025 13:39:49.
text.rb File 2114 bytes May 29 2025 13:39:49.
uninstaller.rb File 11179 bytes May 29 2025 13:39:49.
unknown_command_spell_checker.rb File 411 bytes May 29 2025 13:39:49.
update_suggestion.rb File 1899 bytes May 29 2025 13:39:49.
uri.rb File 2436 bytes May 29 2025 13:39:48.
uri_formatter.rb File 784 bytes May 29 2025 13:39:48.
user_interaction.rb File 13417 bytes May 29 2025 13:39:48.
util.rb File 2519 bytes May 29 2025 13:39:48.
validator.rb File 3717 bytes May 29 2025 13:39:48.
vendored_molinillo.rb File 81 bytes May 29 2025 13:39:49.
vendored_net_http.rb File 233 bytes May 29 2025 13:39:48.
vendored_optparse.rb File 79 bytes May 29 2025 13:39:49.
vendored_securerandom.rb File 87 bytes May 29 2025 13:39:48.
vendored_timeout.rb File 228 bytes May 29 2025 13:39:48.
vendored_tsort.rb File 73 bytes May 29 2025 13:39:49.
version.rb File 13668 bytes May 29 2025 13:39:49.
version_option.rb File 2227 bytes May 29 2025 13:39:48.
yaml_serializer.rb File 2474 bytes May 29 2025 13:39:48.

Reading File: //opt/alt//ruby34/share/rubygems/rubygems/request_set.rb

# frozen_string_literal: true

require_relative "vendored_tsort"

##
# A RequestSet groups a request to activate a set of dependencies.
#
#   nokogiri = Gem::Dependency.new 'nokogiri', '~> 1.6'
#   pg = Gem::Dependency.new 'pg', '~> 0.14'
#
#   set = Gem::RequestSet.new nokogiri, pg
#
#   requests = set.resolve
#
#   p requests.map { |r| r.full_name }
#   #=> ["nokogiri-1.6.0", "mini_portile-0.5.1", "pg-0.17.0"]

class Gem::RequestSet
  include Gem::TSort

  ##
  # Array of gems to install even if already installed

  attr_accessor :always_install

  attr_reader :dependencies

  attr_accessor :development

  ##
  # Errors fetching gems during resolution.

  attr_reader :errors

  ##
  # Set to true if you want to install only direct development dependencies.

  attr_accessor :development_shallow

  ##
  # The set of git gems imported via load_gemdeps.

  attr_reader :git_set # :nodoc:

  ##
  # When true, dependency resolution is not performed, only the requested gems
  # are installed.

  attr_accessor :ignore_dependencies

  attr_reader :install_dir # :nodoc:

  ##
  # If true, allow dependencies to match prerelease gems.

  attr_accessor :prerelease

  ##
  # When false no remote sets are used for resolving gems.

  attr_accessor :remote

  attr_reader :resolver # :nodoc:

  ##
  # Sets used for resolution

  attr_reader :sets # :nodoc:

  ##
  # Treat missing dependencies as silent errors

  attr_accessor :soft_missing

  ##
  # The set of vendor gems imported via load_gemdeps.

  attr_reader :vendor_set # :nodoc:

  ##
  # The set of source gems imported via load_gemdeps.

  attr_reader :source_set

  ##
  # Creates a RequestSet for a list of Gem::Dependency objects, +deps+.  You
  # can then #resolve and #install the resolved list of dependencies.
  #
  #   nokogiri = Gem::Dependency.new 'nokogiri', '~> 1.6'
  #   pg = Gem::Dependency.new 'pg', '~> 0.14'
  #
  #   set = Gem::RequestSet.new nokogiri, pg

  def initialize(*deps)
    @dependencies = deps

    @always_install      = []
    @conservative        = false
    @dependency_names    = {}
    @development         = false
    @development_shallow = false
    @errors              = []
    @git_set             = nil
    @ignore_dependencies = false
    @install_dir         = Gem.dir
    @prerelease          = false
    @remote              = true
    @requests            = []
    @sets                = []
    @soft_missing        = false
    @sorted_requests     = nil
    @specs               = nil
    @vendor_set          = nil
    @source_set          = nil

    yield self if block_given?
  end

  ##
  # Declare that a gem of name +name+ with +reqs+ requirements is needed.

  def gem(name, *reqs)
    if dep = @dependency_names[name]
      dep.requirement.concat reqs
    else
      dep = Gem::Dependency.new name, *reqs
      @dependency_names[name] = dep
      @dependencies << dep
    end
  end

  ##
  # Add +deps+ Gem::Dependency objects to the set.

  def import(deps)
    @dependencies.concat deps
  end

  ##
  # Installs gems for this RequestSet using the Gem::Installer +options+.
  #
  # If a +block+ is given an activation +request+ and +installer+ are yielded.
  # The +installer+ will be +nil+ if a gem matching the request was already
  # installed.

  def install(options, &block) # :yields: request, installer
    if dir = options[:install_dir]
      requests = install_into dir, false, options, &block
      return requests
    end

    @prerelease = options[:prerelease]

    requests = []
    download_queue = Thread::Queue.new

    # Create a thread-safe list of gems to download
    sorted_requests.each do |req|
      download_queue << req
    end

    # Create N threads in a pool, have them download all the gems
    threads = Array.new(Gem.configuration.concurrent_downloads) do
      # When a thread pops this item, it knows to stop running. The symbol
      # is queued here so that there will be one symbol per thread.
      download_queue << :stop

      Thread.new do
        # The pop method will block waiting for items, so the only way
        # to stop a thread from running is to provide a final item that
        # means the thread should stop.
        while req = download_queue.pop
          break if req == :stop
          req.spec.download options unless req.installed?
        end
      end
    end

    # Wait for all the downloads to finish before continuing
    threads.each(&:value)

    # Install requested gems after they have been downloaded
    sorted_requests.each do |req|
      if req.installed?
        req.spec.spec.build_extensions

        if @always_install.none? {|spec| spec == req.spec.spec }
          yield req, nil if block_given?
          next
        end
      end

      spec =
        begin
          req.spec.install options do |installer|
            yield req, installer if block_given?
          end
        rescue Gem::RuntimeRequirementNotMetError => e
          suggestion = "There are no versions of #{req.request} compatible with your Ruby & RubyGems"
          suggestion += ". Maybe try installing an older version of the gem you're looking for?" unless @always_install.include?(req.spec.spec)
          e.suggestion = suggestion
          raise
        end

      requests << spec
    end

    return requests if options[:gemdeps]

    install_hooks requests, options

    requests
  end

  ##
  # Installs from the gem dependencies files in the +:gemdeps+ option in
  # +options+, yielding to the +block+ as in #install.
  #
  # If +:without_groups+ is given in the +options+, those groups in the gem
  # dependencies file are not used.  See Gem::Installer for other +options+.

  def install_from_gemdeps(options, &block)
    gemdeps = options[:gemdeps]

    @install_dir = options[:install_dir] || Gem.dir
    @prerelease  = options[:prerelease]
    @remote      = options[:domain] != :local
    @conservative = true if options[:conservative]

    gem_deps_api = load_gemdeps gemdeps, options[:without_groups], true

    resolve

    if options[:explain]
      puts "Gems to install:"

      sorted_requests.each do |spec|
        puts "  #{spec.full_name}"
      end

      if Gem.configuration.really_verbose
        @resolver.stats.display
      end
    else
      installed = install options, &block

      if options.fetch :lock, true
        lockfile =
          Gem::RequestSet::Lockfile.build self, gemdeps, gem_deps_api.dependencies
        lockfile.write
      end

      installed
    end
  end

  def install_into(dir, force = true, options = {})
    gem_home = ENV["GEM_HOME"]
    ENV["GEM_HOME"] = dir

    existing = force ? [] : specs_in(dir)
    existing.delete_if {|s| @always_install.include? s }

    dir = File.expand_path dir

    installed = []

    options[:development] = false
    options[:install_dir] = dir
    options[:only_install_dir] = true
    @prerelease = options[:prerelease]

    sorted_requests.each do |request|
      spec = request.spec

      if existing.find {|s| s.full_name == spec.full_name }
        yield request, nil if block_given?
        next
      end

      spec.install options do |installer|
        yield request, installer if block_given?
      end

      installed << request
    end

    install_hooks installed, options

    installed
  ensure
    ENV["GEM_HOME"] = gem_home
  end

  ##
  # Call hooks on installed gems

  def install_hooks(requests, options)
    specs = requests.map do |request|
      case request
      when Gem::Resolver::ActivationRequest then
        request.spec.spec
      else
        request
      end
    end

    require_relative "dependency_installer"
    inst = Gem::DependencyInstaller.new options
    inst.installed_gems.replace specs

    Gem.done_installing_hooks.each do |hook|
      hook.call inst, specs
    end unless Gem.done_installing_hooks.empty?
  end

  ##
  # Load a dependency management file.

  def load_gemdeps(path, without_groups = [], installing = false)
    @git_set    = Gem::Resolver::GitSet.new
    @vendor_set = Gem::Resolver::VendorSet.new
    @source_set = Gem::Resolver::SourceSet.new

    @git_set.root_dir = @install_dir

    lock_file = "#{File.expand_path(path)}.lock"
    begin
      tokenizer = Gem::RequestSet::Lockfile::Tokenizer.from_file lock_file
      parser = tokenizer.make_parser self, []
      parser.parse
    rescue Errno::ENOENT
    end

    gf = Gem::RequestSet::GemDependencyAPI.new self, path
    gf.installing = installing
    gf.without_groups = without_groups if without_groups
    gf.load
  end

  def pretty_print(q) # :nodoc:
    q.group 2, "[RequestSet:", "]" do
      q.breakable

      if @remote
        q.text "remote"
        q.breakable
      end

      if @prerelease
        q.text "prerelease"
        q.breakable
      end

      if @development_shallow
        q.text "shallow development"
        q.breakable
      elsif @development
        q.text "development"
        q.breakable
      end

      if @soft_missing
        q.text "soft missing"
      end

      q.group 2, "[dependencies:", "]" do
        q.breakable
        @dependencies.map do |dep|
          q.text dep.to_s
          q.breakable
        end
      end

      q.breakable
      q.text "sets:"

      q.breakable
      q.pp @sets.map(&:class)
    end
  end

  ##
  # Resolve the requested dependencies and return an Array of Specification
  # objects to be activated.

  def resolve(set = Gem::Resolver::BestSet.new)
    @sets << set
    @sets << @git_set
    @sets << @vendor_set
    @sets << @source_set

    set = Gem::Resolver.compose_sets(*@sets)
    set.remote = @remote
    set.prerelease = @prerelease

    resolver = Gem::Resolver.new @dependencies, set
    resolver.development         = @development
    resolver.development_shallow = @development_shallow
    resolver.ignore_dependencies = @ignore_dependencies
    resolver.soft_missing        = @soft_missing

    if @conservative
      installed_gems = {}
      Gem::Specification.find_all do |spec|
        (installed_gems[spec.name] ||= []) << spec
      end
      resolver.skip_gems = installed_gems
    end

    @resolver = resolver

    @requests = resolver.resolve

    @errors = set.errors

    @requests
  end

  ##
  # Resolve the requested dependencies against the gems available via Gem.path
  # and return an Array of Specification objects to be activated.

  def resolve_current
    resolve Gem::Resolver::CurrentSet.new
  end

  def sorted_requests
    @sorted_requests ||= strongly_connected_components.flatten
  end

  def specs
    @specs ||= @requests.map(&:full_spec)
  end

  def specs_in(dir)
    Gem::Util.glob_files_in_dir("*.gemspec", File.join(dir, "specifications")).map do |g|
      Gem::Specification.load g
    end
  end

  def tsort_each_node(&block) # :nodoc:
    @requests.each(&block)
  end

  def tsort_each_child(node) # :nodoc:
    node.spec.dependencies.each do |dep|
      next if dep.type == :development && !@development

      match = @requests.find do |r|
        dep.match?(r.spec.name, r.spec.version, r.spec.is_a?(Gem::Resolver::InstalledSpecification) || @prerelease)
      end

      unless match
        next if dep.type == :development && @development_shallow
        next if @soft_missing
        raise Gem::DependencyError,
              "Unresolved dependency found during sorting - #{dep} (requested by #{node.spec.full_name})"
      end

      yield match
    end
  end
end

require_relative "request_set/gem_dependency_api"
require_relative "request_set/lockfile"
require_relative "request_set/lockfile/tokenizer"

SILENT KILLER Tool