0
      disabled
  V   ˆl–Ãa¾”Šn-j�rà¸ËÊbÑ¿’þ]qfÊñ$y©l/i½š¿çÄ{‹„„-i[D<†ªoZƒ›Ù«Å‚Z_‹I|¥Žƒî4ÃVŸÄÃ  r    ‹      KÎÏ+.Q(N-Q°U(J-,Í,JÕP/JMOÍK-J,IU×ÔÐ´æJë%¦¤%æ¥§jTZšè(€h3MT	s¨„¹	P[jEA~QI±^rFbQbrIjQ1Ð YÖ\ ÄÒmyv     %   	ˆÁ“þBãK6W‰#ÍHÓaxMìÕÿ?ÇÀ¿Æ178¾ÄÃ  ²    	‹      ]ÐÍ
ƒ0ð»OÑ›
CdnÓ";Ø`oP4¸]ê–vàã¯kNí)ðKÉÙ­óÌ�gw†ðù¾ªah<”uÕ\œO,Õ×cF³®c7ø÷†6ö†®NùJ,3ž#ó6eÞEž†”§)²È¦Å�˜g,#ËKÊ²'ÎvKA¬SV´D©Œén�}©é’Y‡`àxïè]³<šÅºiHk,~Ÿµd        ˆÂ‘äÇò 8à^qÇš+�Ç'óÇƒh¹ÆÄÃ      0
  #   ˆÁ’þ[•fÊñ$y©l/i½š¿çÇÀ¿Æ‚¾ÄÃ  k    ‹      KÎÏ+.Q(N-Q°U(J-,Í,JÕP/JMOÍK-J,IU×ÔÐ´æJë%¦¤%æ¥§jT8è(€&@ùÔŠ‚ü¢’b½äŒÄ¢Ää’Ô¢b i@MÖ\ ˆ0Ÿ5_     #   ˆÁ’þ_mfÊñ$y©l/i½š¿çÇÀ¿Æ‚›¾ÄÃ  }    ‹      KÎÏ+.Q(N-Q°U(J-,Í,JÕP/JMOÍK-J,IU×ÔÐ´æJë%¦¤%æ¥§jTºè(€†šhR†FP)cGt)cW¨”©%ÐÔÔŠ‚ü¢’b½äŒÄ¢Ää’Ô¢b €VYs ò£•     ;   ˆÁ’þeyfÊñ$y©l/i½š¿çÇÀ¿Æ156¾a–Ðz¾”d
i?u8 ™¸\i¥1hßÄ  œ    ‹      ]�A
ƒ0E÷ž";I"EºÐ9@oâ`»‰u’‚ÇojgWñþƒÿýb“¸Âíó"ljÂ’KXËFíWeú‹8~©A÷œ ‡*Ë­›ç‡íQq»“% v<kØ˜Ûß0ÓÉ00(Jñ´.OÃý½RŠ­:r>!Å|3ïª/ÆˆÔø     #   ˆÂ’þ^
Í•âHóR4Ø^Ó{5ÏÈÁÀÇ‚_¿¾Ä  w    ‹      KÎÏ+.Q(N-Q°U(J-,Í,JÕP/JMOÍK-J,IU×Ô0¨0440wÓ´æªÒKLI	JÌKO…è(€&.šhR¦FP)sS ÖÔŠ‚ü¢’b½äŒÄ¢Ää’Ô¢b }@ó¬¹ å#kj�     D   ˆl–ßi~””†»%�À¶¦-ÿ�þBá%Y¹ë!+ÍÊ2ùÉƒmæ_È_�uÐb&=LyZËcõÀÆ Ï    # frozen_string_literal: true

require_relative "text"
##
# A Source knows how to list and fetch gems from a RubyGems marshal index.
#
# There are other Source subclasses for installed gems, local gems, the
# bundler dependency API and so-forth.

class Gem::Source
  include Comparable
  include Gem::Text

  FILES = { # :nodoc:
    :released   => 'specs',
    :latest     => 'latest_specs',
    :prerelease => 'prerelease_specs',
  }.freeze

  ##
  # The URI this source will fetch gems from.

  attr_reader :uri

  ##
  # Creates a new Source which will use the index located at +uri+.

  def initialize(uri)
    begin
      unless uri.kind_of? URI
        uri = URI.parse(uri.to_s)
      end
    rescue URI::InvalidURIError
      raise if Gem::Source == self.class
    end

    @uri = uri
    @update_cache = nil
  end

  ##
  # Sources are ordered by installation preference.

  def <=>(other)
    case other
    when Gem::Source::Installed,
         Gem::Source::Local,
         Gem::Source::Lock,
         Gem::Source::SpecificFile,
         Gem::Source::Git,
         Gem::Source::Vendor then
      -1
    when Gem::Source then
      if !@uri
        return 0 unless other.uri
        return 1
      end

      return -1 if !other.uri

      # Returning 1 here ensures that when sorting a list of sources, the
      # original ordering of sources supplied by the user is preserved.
      return 1 unless @uri.to_s == other.uri.to_s

      0
    else
      nil
    end
  end

  def ==(other) # :nodoc:
    self.class === other and @uri == other.uri
  end

  alias_method :eql?, :== # :nodoc:

  ##
  # Returns a Set that can fetch specifications from this source.

  def dependency_resolver_set # :nodoc:
    return Gem::Resolver::IndexSet.new self if 'file' == uri.scheme

    fetch_uri = if uri.host == "rubygems.org"
      index_uri = uri.dup
      index_uri.host = "index.rubygems.org"
      index_uri
    else
      uri
    end

    bundler_api_uri = enforce_trailing_slash(fetch_uri)

    begin
      fetcher = Gem::RemoteFetcher.fetcher
      response = fetcher.fetch_path bundler_api_uri, nil, true
    rescue Gem::RemoteFetcher::FetchError
      Gem::Resolver::IndexSet.new self
    else
      Gem::Resolver::APISet.new response.uri + "./info/"
    end
  end

  def hash # :nodoc:
    @uri.hash
  end

  ##
  # Returns the local directory to write +uri+ to.

  def cache_dir(uri)
    # Correct for windows paths
    escaped_path = uri.path.sub(/^\/([a-z]):\//i, '/\\1-/')
    escaped_path.tap(&Gem::UNTAINT)

    File.join Gem.spec_cache_dir, "#{uri.host}%#{uri.port}", File.dirname(escaped_path)
  end

  ##
  # Returns true when it is possible and safe to update the cache directory.

  def update_cache?
    return @update_cac