GRAYBYTE WORDPRESS FILE MANAGER3701

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.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
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/ruby33/share/rubygems/rubygems/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/ruby33/share/rubygems/rubygems//dependency.rb
# frozen_string_literal: true

##
# The Dependency class holds a Gem name and a Gem::Requirement.

class Gem::Dependency
  ##
  # Valid dependency types.
  #--
  # When this list is updated, be sure to change
  # Gem::Specification::CURRENT_SPECIFICATION_VERSION as well.
  #
  # REFACTOR: This type of constant, TYPES, indicates we might want
  # two classes, used via inheritance or duck typing.

  TYPES = [
    :development,
    :runtime,
  ].freeze

  ##
  # Dependency name or regular expression.

  attr_accessor :name

  ##
  # Allows you to force this dependency to be a prerelease.

  attr_writer :prerelease

  ##
  # Constructs a dependency with +name+ and +requirements+. The last
  # argument can optionally be the dependency type, which defaults to
  # <tt>:runtime</tt>.

  def initialize(name, *requirements)
    case name
    when String then # ok
    when Regexp then
      msg = ["NOTE: Dependency.new w/ a regexp is deprecated.",
             "Dependency.new called from #{Gem.location_of_caller.join(":")}"]
      warn msg.join("\n") unless Gem::Deprecate.skip
    else
      raise ArgumentError,
            "dependency name must be a String, was #{name.inspect}"
    end

    type         = Symbol === requirements.last ? requirements.pop : :runtime
    requirements = requirements.first if requirements.length == 1 # unpack

    unless TYPES.include? type
      raise ArgumentError, "Valid types are #{TYPES.inspect}, " \
                           "not #{type.inspect}"
    end

    @name        = name
    @requirement = Gem::Requirement.create requirements
    @type        = type
    @prerelease  = false

    # This is for Marshal backwards compatibility. See the comments in
    # +requirement+ for the dirty details.

    @version_requirements = @requirement
  end

  ##
  # A dependency's hash is the XOR of the hashes of +name+, +type+,
  # and +requirement+.

  def hash # :nodoc:
    name.hash ^ type.hash ^ requirement.hash
  end

  def inspect # :nodoc:
    if prerelease?
      format("<%s type=%p name=%p requirements=%p prerelease=ok>", self.class, type, name, requirement.to_s)
    else
      format("<%s type=%p name=%p requirements=%p>", self.class, type, name, requirement.to_s)
    end
  end

  ##
  # Does this dependency require a prerelease?

  def prerelease?
    @prerelease || requirement.prerelease?
  end

  ##
  # Is this dependency simply asking for the latest version
  # of a gem?

  def latest_version?
    @requirement.none?
  end

  def pretty_print(q) # :nodoc:
    q.group 1, "Gem::Dependency.new(", ")" do
      q.pp name
      q.text ","
      q.breakable

      q.pp requirement

      q.text ","
      q.breakable

      q.pp type
    end
  end

  ##
  # What does this dependency require?

  def requirement
    return @requirement if defined?(@requirement) && @requirement

    # @version_requirements and @version_requirement are legacy ivar
    # names, and supported here because older gems need to keep
    # working and Dependency doesn't implement marshal_dump and
    # marshal_load. In a happier world, this would be an
    # attr_accessor. The horrifying instance_variable_get you see
    # below is also the legacy of some old restructurings.
    #
    # Note also that because of backwards compatibility (loading new
    # gems in an old RubyGems installation), we can't add explicit
    # marshaling to this class until we want to make a big
    # break. Maybe 2.0.
    #
    # Children, define explicit marshal and unmarshal behavior for
    # public classes. Marshal formats are part of your public API.

    # REFACTOR: See above

    if defined?(@version_requirement) && @version_requirement
      version = @version_requirement.instance_variable_get :@version
      @version_requirement = nil
      @version_requirements = Gem::Requirement.new version
    end

    @requirement = @version_requirements if defined?(@version_requirements)
  end

  def requirements_list
    requirement.as_list
  end

  def to_s # :nodoc:
    if type != :runtime
      "#{name} (#{requirement}, #{type})"
    else
      "#{name} (#{requirement})"
    end
  end

  ##
  # Dependency type.

  def type
    @type ||= :runtime
  end

  def runtime?
    @type == :runtime || !@type
  end

  def ==(other) # :nodoc:
    Gem::Dependency === other &&
      name        == other.name &&
      type        == other.type &&
      requirement == other.requirement
  end

  ##
  # Dependencies are ordered by name.

  def <=>(other)
    name <=> other.name
  end

  ##
  # Uses this dependency as a pattern to compare to +other+. This
  # dependency will match if the name matches the other's name, and
  # other has only an equal version requirement that satisfies this
  # dependency.

  def =~(other)
    unless Gem::Dependency === other
      return unless other.respond_to?(:name) && other.respond_to?(:version)
      other = Gem::Dependency.new other.name, other.version
    end

    return false unless name === other.name

    reqs = other.requirement.requirements

    return false unless reqs.length == 1
    return false unless reqs.first.first == "="

    version = reqs.first.last

    requirement.satisfied_by? version
  end

  alias_method :===, :=~

  ##
  # :call-seq:
  #   dep.match? name          => true or false
  #   dep.match? name, version => true or false
  #   dep.match? spec          => true or false
  #
  # Does this dependency match the specification described by +name+ and
  # +version+ or match +spec+?
  #
  # NOTE:  Unlike #matches_spec? this method does not return true when the
  # version is a prerelease version unless this is a prerelease dependency.

  def match?(obj, version=nil, allow_prerelease=false)
    if !version
      name = obj.name
      version = obj.version
    else
      name = obj
    end

    return false unless self.name === name

    version = Gem::Version.new version

    return true if requirement.none? && !version.prerelease?
    return false if version.prerelease? &&
                    !allow_prerelease &&
                    !prerelease?

    requirement.satisfied_by? version
  end

  ##
  # Does this dependency match +spec+?
  #
  # NOTE:  This is not a convenience method.  Unlike #match? this method
  # returns true when +spec+ is a prerelease version even if this dependency
  # is not a prerelease dependency.

  def matches_spec?(spec)
    return false unless name === spec.name
    return true  if requirement.none?

    requirement.satisfied_by?(spec.version)
  end

  ##
  # Merges the requirements of +other+ into this dependency

  def merge(other)
    unless name == other.name
      raise ArgumentError,
            "#{self} and #{other} have different names"
    end

    default = Gem::Requirement.default
    self_req = requirement
    other_req = other.requirement

    return self.class.new name, self_req  if other_req == default
    return self.class.new name, other_req if self_req  == default

    self.class.new name, self_req.as_list.concat(other_req.as_list)
  end

  def matching_specs(platform_only = false)
    matches = Gem::Specification.find_all_by_name(name, requirement)

    if platform_only
      matches.reject! do |spec|
        spec.nil? || !Gem::Platform.match_spec?(spec)
      end
    end

    matches.reject(&:ignored?)
  end

  ##
  # True if the dependency will not always match the latest version.

  def specific?
    @requirement.specific?
  end

  def to_specs
    matches = matching_specs true

    # TODO: check Gem.activated_spec[self.name] in case matches falls outside

    if matches.empty?
      specs = Gem::Specification.stubs_for name

      if specs.empty?
        raise Gem::MissingSpecError.new name, requirement
      else
        raise Gem::MissingSpecVersionError.new name, requirement, specs
      end
    end

    # TODO: any other resolver validations should go here

    matches
  end

  def to_spec
    matches = to_specs.compact

    active = matches.find(&:activated?)
    return active if active

    unless prerelease?
      # Consider prereleases only as a fallback
      pre, matches = matches.partition {|spec| spec.version.prerelease? }
      matches = pre if matches.empty?
    end

    matches.first
  end

  def identity
    if prerelease?
      if specific?
        :complete
      else
        :abs_latest
      end
    elsif latest_version?
      :latest
    else
      :released
    end
  end

  def encode_with(coder) # :nodoc:
    coder.add "name", @name
    coder.add "requirement", @requirement
    coder.add "type", @type
    coder.add "prerelease", @prerelease
    coder.add "version_requirements", @version_requirements
  end
end

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 14 2024 08:49:03
root / root
0755
commands
--
May 13 2025 08:35:36
root / linksafe
0755
core_ext
--
May 13 2025 08:35:36
root / linksafe
0755
defaults
--
May 13 2025 08:35:36
root / linksafe
0755
ext
--
May 13 2025 08:35:36
root / linksafe
0755
gemcutter_utilities
--
May 13 2025 08:35:36
root / linksafe
0755
package
--
May 13 2025 08:35:36
root / linksafe
0755
request
--
May 13 2025 08:35:36
root / linksafe
0755
request_set
--
May 13 2025 08:35:36
root / linksafe
0755
resolver
--
May 13 2025 08:35:36
root / linksafe
0755
safe_marshal
--
May 13 2025 08:35:36
root / linksafe
0755
security
--
May 13 2025 08:35:36
root / linksafe
0755
source
--
May 13 2025 08:35:36
root / linksafe
0755
ssl_certs
--
April 24 2025 07:57:41
root / linksafe
0755
util
--
May 13 2025 08:35:36
root / linksafe
0755
vendor
--
April 24 2025 07:57:40
root / linksafe
0755
available_set.rb
3.003 KB
April 24 2025 07:57:47
root / linksafe
0644
basic_specification.rb
8.173 KB
April 24 2025 07:57:47
root / linksafe
0644
bundler_version_finder.rb
1.962 KB
April 24 2025 07:57:47
root / linksafe
0644
ci_detector.rb
3.712 KB
April 24 2025 07:57:47
root / linksafe
0644
command.rb
15.971 KB
April 24 2025 07:57:47
root / linksafe
0644
command_manager.rb
5.643 KB
April 24 2025 07:57:47
root / linksafe
0644
compatibility.rb
0.998 KB
April 24 2025 07:57:47
root / linksafe
0644
config_file.rb
15.789 KB
April 24 2025 07:57:47
root / linksafe
0644
defaults.rb
7.346 KB
April 24 2025 07:57:47
root / linksafe
0644
dependency.rb
8.449 KB
April 24 2025 07:57:47
root / linksafe
0644
dependency_installer.rb
9.906 KB
April 24 2025 07:57:47
root / linksafe
0644
dependency_list.rb
5.551 KB
April 24 2025 07:57:47
root / linksafe
0644
deprecate.rb
5.038 KB
April 24 2025 07:57:47
root / linksafe
0644
doctor.rb
3.129 KB
April 24 2025 07:57:47
root / linksafe
0644
errors.rb
4.526 KB
April 24 2025 07:57:47
root / linksafe
0644
exceptions.rb
7.329 KB
April 24 2025 07:57:47
root / linksafe
0644
ext.rb
0.486 KB
April 24 2025 07:57:47
root / linksafe
0644
gem_runner.rb
1.894 KB
April 24 2025 07:57:47
root / linksafe
0644
gemcutter_utilities.rb
11.174 KB
April 24 2025 07:57:47
root / linksafe
0644
gemspec_helpers.rb
0.385 KB
April 24 2025 07:57:47
root / linksafe
0644
install_default_message.rb
0.341 KB
April 24 2025 07:57:47
root / linksafe
0644
install_message.rb
0.315 KB
April 24 2025 07:57:47
root / linksafe
0644
install_update_options.rb
6.388 KB
April 24 2025 07:57:47
root / linksafe
0644
installer.rb
27.683 KB
April 24 2025 07:57:47
root / linksafe
0644
installer_uninstaller_utils.rb
0.753 KB
April 24 2025 07:57:47
root / linksafe
0644
local_remote_options.rb
3.614 KB
April 24 2025 07:57:47
root / linksafe
0644
name_tuple.rb
2.385 KB
April 24 2025 07:57:47
root / linksafe
0644
openssl.rb
0.122 KB
April 24 2025 07:57:47
root / linksafe
0644
package.rb
18.829 KB
April 24 2025 07:57:47
root / linksafe
0644
package_task.rb
3.788 KB
April 24 2025 07:57:47
root / linksafe
0644
path_support.rb
1.773 KB
April 24 2025 07:57:47
root / linksafe
0644
platform.rb
8.351 KB
April 24 2025 07:57:47
root / linksafe
0644
psych_tree.rb
0.776 KB
April 24 2025 07:57:47
root / linksafe
0644
query_utils.rb
8.495 KB
April 24 2025 07:57:47
root / linksafe
0644
rdoc.rb
0.227 KB
April 24 2025 07:57:47
root / linksafe
0644
remote_fetcher.rb
9.379 KB
April 24 2025 07:57:47
root / linksafe
0644
request.rb
8.701 KB
April 24 2025 07:57:47
root / linksafe
0644
request_set.rb
11.287 KB
April 24 2025 07:57:47
root / linksafe
0644
requirement.rb
7.002 KB
April 24 2025 07:57:47
root / linksafe
0644
resolver.rb
9.437 KB
April 24 2025 07:57:47
root / linksafe
0644
s3_uri_signer.rb
5.963 KB
April 24 2025 07:57:47
root / linksafe
0644
safe_marshal.rb
1.923 KB
April 24 2025 07:57:47
root / linksafe
0644
safe_yaml.rb
1.042 KB
April 24 2025 07:57:47
root / linksafe
0644
security.rb
21.693 KB
April 24 2025 07:57:47
root / linksafe
0644
security_option.rb
1.059 KB
April 24 2025 07:57:47
root / linksafe
0644
shellwords.rb
0.064 KB
April 24 2025 07:57:47
root / linksafe
0644
source.rb
5.783 KB
April 24 2025 07:57:47
root / linksafe
0644
source_list.rb
2.424 KB
April 24 2025 07:57:47
root / linksafe
0644
spec_fetcher.rb
6.16 KB
April 24 2025 07:57:47
root / linksafe
0644
specification.rb
69.099 KB
April 24 2025 07:57:47
root / linksafe
0644
specification_policy.rb
15.59 KB
April 24 2025 07:57:47
root / linksafe
0644
specification_record.rb
5.207 KB
April 24 2025 07:57:47
root / linksafe
0644
stub_specification.rb
4.959 KB
April 24 2025 07:57:47
root / linksafe
0644
text.rb
2.064 KB
April 24 2025 07:57:47
root / linksafe
0644
uninstaller.rb
10.94 KB
April 24 2025 07:57:47
root / linksafe
0644
unknown_command_spell_checker.rb
0.401 KB
April 24 2025 07:57:47
root / linksafe
0644
update_suggestion.rb
1.854 KB
April 24 2025 07:57:47
root / linksafe
0644
uri.rb
2.379 KB
April 24 2025 07:57:47
root / linksafe
0644
uri_formatter.rb
0.766 KB
April 24 2025 07:57:47
root / linksafe
0644
user_interaction.rb
13.103 KB
April 24 2025 07:57:47
root / linksafe
0644
util.rb
2.46 KB
April 24 2025 07:57:47
root / linksafe
0644
validator.rb
3.63 KB
April 24 2025 07:57:47
root / linksafe
0644
vendored_molinillo.rb
0.079 KB
April 24 2025 07:57:47
root / linksafe
0644
vendored_net_http.rb
0.228 KB
April 24 2025 07:57:47
root / linksafe
0644
vendored_optparse.rb
0.077 KB
April 24 2025 07:57:47
root / linksafe
0644
vendored_securerandom.rb
0.108 KB
April 24 2025 07:57:47
root / linksafe
0644
vendored_timeout.rb
0.223 KB
April 24 2025 07:57:47
root / linksafe
0644
vendored_tsort.rb
0.071 KB
April 24 2025 07:57:47
root / linksafe
0644
version.rb
12.979 KB
April 24 2025 07:57:47
root / linksafe
0644
version_option.rb
2.175 KB
April 24 2025 07:57:47
root / linksafe
0644
yaml_serializer.rb
2.416 KB
April 24 2025 07:57:47
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF