128
      \_SB_.CPUS.C002
  5   ˆl–Ðz¾”*i?u8 q¡\e•1hß�þB g]�¶@á/óÃƒh¹ÂÁÀ      511
  5   ˆl–Ðz¾”*i?u8 q—îµ1hß�þB g]ÄG ¿ŸÄƒh¹ÃÂÁ      128
  7   	ˆl–Ðz¾”*i?u8 q·nå1hß‘äÇò 8à
é_)FËR?Åƒh¹ÄÃÂ      	0
      ˆ¾‘äÇò 8à
é_” `þÅƒh¹ÄÃÂ      0
     ˆÁ�þB g]�×D€ïóÅƒh¹ÄÃÂ      \_SB_.CPUS.C002
  F   ˆl–äY>”ŠhŠm@5p@¸ËŠbÑ¿�þDû.¬ã!eÑ=š� þÆ„l?Å_�uÐb&=LyZËcõÅÄ )7    # frozen_string_literal: true

module Bundler
  class Runtime
    include SharedHelpers

    def initialize(root, definition)
      @root = root
      @definition = definition
    end

    def setup(*groups)
      @definition.ensure_equivalent_gemfile_and_lockfile if Bundler.frozen_bundle?

      # Has to happen first
      clean_load_path

      specs = @definition.specs_for(groups)

      SharedHelpers.set_bundle_environment
      Bundler.rubygems.replace_entrypoints(specs)

      # Activate the specs
      load_paths = specs.map do |spec|
        check_for_activated_spec!(spec)

        Bundler.rubygems.mark_loaded(spec)
        spec.load_paths.reject {|path| $LOAD_PATH.include?(path) }
      end.reverse.flatten

      Bundler.rubygems.add_to_load_path(load_paths)

      setup_manpath

      lock(:preserve_unknown_sections => true)

      self
    end

    def require(*groups)
      groups.map!(&:to_sym)
      groups = [:default] if groups.empty?

      @definition.dependencies.each do |dep|
        # Skip the dependency if it is not in any of the requested groups, or
        # not for the current platform, or doesn't match the gem constraints.
        next unless (dep.groups & groups).any? && dep.should_include?

        required_file = nil

        begin
          # Loop through all the specified autorequires for the
          # dependency. If there are none, use the dependency's name
          # as the autorequire.
          Array(dep.autorequire || dep.name).each do |file|
            # Allow `require: true` as an alias for `require: <name>`
            file = dep.name if file == true
            required_file = file
            begin
              Kernel.require file
            rescue RuntimeError => e
              raise e if e.is_a?(LoadError) # we handle this a little later
              raise Bundler::GemRequireError.new e,
                "There was an error while trying to load the gem '#{file}'."
            end
          end
        rescue LoadError => e
          raise if dep.autorequire || e.path != required_file

          if dep.autorequire.nil? && dep.name.include?("-")
            begin
              namespaced_file = dep.name.tr("-", "/")
              Kernel.require namespaced_file
            rescue LoadError => e
              raise if e.path != namespaced_file
            end
          end
        end
      end
    end

    def self.definition_method(meth)
      define_method(meth) do
        raise ArgumentError, "no definition when calling Runtime##{meth}" unless @definition
        @definition.send(meth)
      end
    end
    private_class_method :definition_method

    definition_method :requested_specs
    definition_method :specs
    definition_method :dependencies
    definition_method :current_dependencies
    definition_method :requires

    def lock(opts = {})
      return if @definition.nothing_changed? && !@definition.unlocking?
      @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections])
    end

    alias_method :gems, :specs

    def cache(custom_path = nil, local = false)
      cache_path = Bundler.app_cache(custom_path)
      SharedHelpers.filesystem_access(cache_path) do |p|
        FileUtils.mkdir_p(p)
      end unless File.exist?(cache_path)

      Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}"

      specs_to_cache = if Bundler.settings[:cache_all_platforms]
        @definition.resolve.materialized_for_all_platforms
      else
        begin
          specs
        rescue GemNotFound
          if local
            Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.s