$43 GRAYBYTE WORDPRESS FILE MANAGER $19

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.8/bundler/fetcher/

HOME
Current File : /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.8/bundler/fetcher//dependency.rb
# frozen_string_literal: true

require_relative "base"
require "cgi"

module Bundler
  class Fetcher
    class Dependency < Base
      def available?
        @available ||= fetch_uri.scheme != "file" && downloader.fetch(dependency_api_uri)
      rescue NetworkDownError => e
        raise HTTPError, e.message
      rescue AuthenticationRequiredError
        # Fail since we got a 401 from the server.
        raise
      rescue HTTPError
        false
      end

      def api_fetcher?
        true
      end

      def specs(gem_names, full_dependency_list = [], last_spec_list = [])
        query_list = gem_names.uniq - full_dependency_list

        log_specs "Query List: #{query_list.inspect}"

        return last_spec_list if query_list.empty?

        spec_list, deps_list = Bundler::Retry.new("dependency api", FAIL_ERRORS).attempts do
          dependency_specs(query_list)
        end

        returned_gems = spec_list.map(&:first).uniq
        specs(deps_list, full_dependency_list + returned_gems, spec_list + last_spec_list)
      rescue MarshalError
        Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
        Bundler.ui.debug "could not fetch from the dependency API, trying the full index"
        nil
      rescue HTTPError, GemspecError
        Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
        Bundler.ui.debug "could not fetch from the dependency API\nit's suggested to retry using the full index via `bundle install --full-index`"
        nil
      end

      def dependency_specs(gem_names)
        Bundler.ui.debug "Query Gemcutter Dependency Endpoint API: #{gem_names.join(",")}"

        gem_list = unmarshalled_dep_gems(gem_names)
        get_formatted_specs_and_deps(gem_list)
      end

      def unmarshalled_dep_gems(gem_names)
        gem_list = []
        gem_names.each_slice(Source::Rubygems::API_REQUEST_SIZE) do |names|
          marshalled_deps = downloader.fetch(dependency_api_uri(names)).body
          gem_list.concat(Bundler.load_marshal(marshalled_deps))
        end
        gem_list
      end

      def get_formatted_specs_and_deps(gem_list)
        deps_list = []
        spec_list = []

        gem_list.each do |s|
          deps_list.concat(s[:dependencies].map(&:first))
          deps = s[:dependencies].map {|n, d| [n, d.split(", ")] }
          spec_list.push([s[:name], s[:number], s[:platform], deps])
        end
        [spec_list, deps_list]
      end

      def dependency_api_uri(gem_names = [])
        uri = fetch_uri + "api/v1/dependencies"
        uri.query = "gems=#{CGI.escape(gem_names.sort.join(","))}" if gem_names.any?
        uri
      end
    end
  end
end


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
21 Mar 2024 10.21 AM
root / root
0755
base.rb
0.962 KB
30 Mar 2023 12.34 PM
root / root
0644
compact_index.rb
4.46 KB
30 Mar 2023 12.34 PM
root / root
0644
dependency.rb
2.646 KB
30 Mar 2023 12.34 PM
root / root
0644
downloader.rb
3.029 KB
30 Mar 2023 12.34 PM
root / root
0644
index.rb
1.913 KB
30 Mar 2023 12.34 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF