7
  %   #ˆÇ“þYrE›’Wž‘¡JFÀ¦öjÿŸÍÆÅÌ440ÄÀÉ ¸    #‹      }RÏoÓ0>Ç…Õ“3Jrß4ÄCLlb‡Þ&„ŒóºXMýÌ³­®šò¿óÜ$mE—Æñ÷ë}/­/Dñx¿’Ö€ Ûýe]ïv»
=ß`"ÒKÝŒPom|?¾T¾õ¢¸I±E’+üeu�ßÐ{  ?Ü�µX$6‘¬‰‹+!ºåWÄ�¼–¿“%P‹ªÎ7‹òê¿Å¾h‘ösê˜UÂt:yöÎ<iÒ]ÝßðÁ5aæý&
e,ª7‰îŽiÉ‡Ïè@öeÆ‚˜ÈÉØÚPv_i¦•	Å(¼”Ê.%;4¬~?èM)¯?LöŠ	¥|wU¤år0ÊÁ|ê¹WÑ‹~ÚÙú¸»ÿVUåqÑ·ßŸîîX´NÎD‹N¡Ï�p(6zV�ûy•ëqóçô±öÄ2<ju"ôœ3ùÎ'Rš^'?ÿXJ§·ÀÇäX[M9®�Gl‡ÿB.uT‚<BF«‘Rž‚™³ mëm—sÆÚð3³óø£b~?vn¾¼üYZå	#Æ½ÏA.u/a‹Mê ‚W�Ã¿güçšm    D   %ˆl–ßi~””†»%�À¶¦-ÿ�þBWÞY¹ë!+ÍÊ2ùÎƒuæEÍ_�uÐb&=LyZËcõÂË ˜    %# frozen_string_literal: true
##
# BasicSpecification is an abstract class which implements some common code
# used by both Specification and StubSpecification.

class Gem::BasicSpecification
  ##
  # Allows installation of extensions for git: gems.

  attr_writer :base_dir # :nodoc:

  ##
  # Sets the directory where extensions for this gem will be installed.

  attr_writer :extension_dir # :nodoc:

  ##
  # Is this specification ignored for activation purposes?

  attr_writer :ignored # :nodoc:

  ##
  # The path this gemspec was loaded from.  This attribute is not persisted.

  attr_accessor :loaded_from

  ##
  # Allows correct activation of git: and path: gems.

  attr_writer :full_gem_path # :nodoc:

  def initialize
    internal_init
  end

  def self.default_specifications_dir
    Gem.default_specifications_dir
  end

  class << self
    extend Gem::Deprecate
    rubygems_deprecate :default_specifications_dir, "Gem.default_specifications_dir"
  end

  ##
  # The path to the gem.build_complete file within the extension install
  # directory.

  def gem_build_complete_path # :nodoc:
    File.join extension_dir, 'gem.build_complete'
  end

  ##
  # True when the gem has been activated

  def activated?
    raise NotImplementedError
  end

  ##
  # Returns the full path to the base gem directory.
  #
  # eg: /usr/local/lib/ruby/gems/1.8

  def base_dir
    raise NotImplementedError
  end

  ##
  # Return true if this spec can require +file+.

  def contains_requirable_file?(file)
    if @ignored
      return false
    elsif missing_extensions?
      @ignored = true

      if Gem::Platform::RUBY == platform || Gem::Platform.local === platform
        warn "Ignoring #{full_name} because its extensions are not built. " +
          "Try: gem pristine #{name} --version #{version}"
      end

      return false
    end

    have_file? file, Gem.suffixes
  end

  def default_gem?
    loaded_from &&
      File.dirname(loaded_from) == Gem.default_specifications_dir
  end

  ##
  # Returns full path to the directory where gem's extensions are installed.

  def extension_dir
    @extension_dir ||= File.expand_path(File.join(extensions_dir, full_name)).tap(&Gem::UNTAINT)
  end

  ##
  # Returns path to the extensions directory.

  def extensions_dir
    Gem.default_ext_dir_for(base_dir) ||
      File.join(base_dir, 'extensions', Gem::Platform.local.to_s,
                Gem.extension_api_version)
  end

  def find_full_gem_path # :nodoc:
    # TODO: also, shouldn't it default to full_name if it hasn't been written?
    path = File.expand_path File.join(gems_dir, full_name)
    path.tap(&Gem::UNTAINT)
    path
  end

  private :find_full_gem_path

  ##
  # The full path to the gem (install path + full name).

  def full_gem_path
    # TODO: This is a heavily used method by gems, so we'll need
    # to aleast just alias it to #gem_dir rather than remove it.
    @full_gem_path ||= find_full_gem_path
  end

  ##
  # Returns the full name (name-version) of this Gem.  Platform information
  # is included (name-version-platform) if it is specified and not the
  # default Ruby platform.

  def full_name
    if platform == Gem::Platform::RUBY or platform.nil?
      "#{name}-#{version}".dup.tap(&Gem::UNTAINT)
    else
      "#{name}-#{version}-#{platform}".dup.tap(&Gem::UNTAINT)
    end
  end

  ##
  # Full paths in the gem to add to <code>$LOAD_PATH</code> when this gem is
  # activated.

  def full_require_paths
    @full_require_paths ||=
    begin
      full_path