This method is responsible for ensuring there is a working
 Gemfile, and that `fastlane` is defined as a dependency
 while also having `rubygems` as a gem source
553885
def add_or_update_gemfile(update_gemfile_if_needed: false)
      if gemfile_exists?
        ensure_gemfile_valid!(update_gemfile_if_needed: update_gemfile_if_needed)
      else
        if update_gemfile_if_needed || UI.confirm("It is recommended to run fastlane with a Gemfile set up, do you want fastlane to create one for you?")
          setup_gemfile!
        end
      end
      return gemfile_path
    end
765960
def install
      cache_path.rmtree if cache_path.exist?
      cache_path.mkpath
      Halite.convert(gem_name, cache_path)
      validate_cached!(cache_path)
    end
606001
def check_dependencies(specs)
      missing = check_app_requirement(specs)

      present = exclude_specs(installed, specs)
      future = present + specs

      check_all_dependencies(specs, future, missing)
    end
44590
def install_local(path, opts={})
      plugin_source = Gem::Source::SpecificFile.new(path)
      plugin_info = {
        plugin_source.spec.name => {
          "gem_version" => plugin_source.spec.version.to_s,
          "local_source" => plugin_source,
          "sources" => opts.fetch(:sources, [])
        }
      }
      @logger.debug("Installing local plugin - #{plugin_info}")
      internal_install(plugin_info, nil, env_local: opts[:env_local])
      plugin_source.spec
    end
1336716
def wagonfile_remove(specs)
      wagonfile_edit(specs) do |spec, content|
        content.sub(gem_declaration_regexp(spec.name), '')
      end
    end
649741
def write_script_for(gem_name, filespec = DEFAULT_SCRIPT_NAME)
      File.write(filespec, script_for(gem_name, filespec))
      FileUtils.chmod("u=wrx,go=rx", filespec)
    end
1322433
def find_gem_file(rubygem, file)
      begin gem(rubygem); rescue Exception; end
      (dir = $:.find {|e| File.exist?(File.join(e, file)) }) && File.join(dir, file)
    end
1205661
def gem_dependencies(gem_name)
      Utils.cache.cache(gem_name) do
        gems = Utils.gems_collection(false)
        gem_collection = gems.find_by_name(gem_name)

        return '' if gem_collection.nil?

        gem_collection = Parallel.map(gem_collection, in_threads: 4) do |gem|
          [gem, spec_for(gem.name, gem.number, gem.platform)]
        end
        gem_collection.reject! do |_, spec|
          spec.nil?
        end

        Parallel.map(gem_collection, in_threads: 4) do |gem, spec|
          dependencies = spec.dependencies.select do |d|
            d.type == :runtime
          end

          dependencies = Parallel.map(dependencies, in_threads: 4) do |d|
            [d.name.is_a?(Array) ? d.name.first : d.name, d.requirement.to_s]
          end

          {
            name: gem.name,
            number: gem.number,
            platform: gem.platform,
            dependencies: dependencies
          }
        end
      end
    end
13244
def generate_require_paths
      return configured_require_paths unless gemspec?
      result = []
      gemspecs.each do |file|
        base = File.dirname(file)
        # @todo Evaluating gemspec files violates the goal of not running
        #   workspace code, but this is how Gem::Specification.load does it
        #   anyway.
        begin
          spec = eval(File.read(file), binding, file)
          next unless Gem::Specification === spec
          result.concat(spec.require_paths.map { |path| File.join(base, path) })
        rescue Exception => e
          # Don't die if we have an error during eval-ing a gem spec.
          # Concat the default lib directory instead.
          Solargraph.logger.warn "Error reading #{file}: [#{e.class}] #{e.message}"
          result.push File.join(base, 'lib')
        end
      end
      result.concat config.require_paths
      result.push File.join(directory, 'lib') if result.empty?
      result
    end
253395
function googAddDependency(file, provides, requires) {
    provides.forEach(function(provided) {
      symbolsFile[provided] = file;
      deps[provided] = deps[provided] || [];
      Array.prototype.push.apply(deps[provided], requires)
    });
  }
1242970
def dependencies
      gemspec.dependencies.map(&:name).
                           select { |dep| dep =~ /\A#{Wagons.app_name}_/ }.
                           map { |dep| Wagons.find(dep) || fail("No wagon #{dep} found") }
    end
1070966
def load_gemspec
      file = gemspec
      if yaml?(file)
        ::Gem::Specification.from_yaml(File.new(file))
      else
        ::Gem::Specification.load(file)
      end
    end
1348347
def install_dependencies!
      # Using puts instead of `UI` to have the same style as the `echo`
      puts("Installing plugin dependencies...")
      ensure_plugins_attached!
      with_clean_bundler_env do
        cmd = "bundle install"
        cmd << " --quiet" unless FastlaneCore::Globals.verbose?
        cmd << " && echo 'Successfully installed plugins'"
        UI.command(cmd) if FastlaneCore::Globals.verbose?
        exec(cmd)
      end
    end
1055081
def with_gemfile(path, *args, &block)
      # Make sure that if block calls  #gemfile we still return the gemfile for this
      # process, regardless of what's in ENV temporarily
      @gemfile_changed = true
      @process_gemfile = ENV['BUNDLE_GEMFILE']
      Bundler.with_clean_env do
        ENV['BUNDLE_GEMFILE'] = path
        block.call(*args)
      end
    ensure
      @gemfile_changed = false
      ENV['BUNDLE_GEMFILE'] = @process_gemfile
    end
887756
def init_rvm(rootdir = Dir.pwd, gemset = '')
      rvm_files = {
        :version => File.join(rootdir, '.ruby-version'),
        :gemset  => File.join(rootdir, '.ruby-gemset')
      }
      unless File.exist?( (rvm_files[:version]).to_s)
        v = select_from(FalkorLib.config[:rvm][:rubies],
                        "Select RVM ruby to configure for this directory",
                        3)
        File.open( rvm_files[:version], 'w') do |f|
          f.puts v
        end
      end
      unless File.exist?( (rvm_files[:gemset]).to_s)
        g = (gemset.empty?) ? ask("Enter RVM gemset name for this directory", File.basename(rootdir)) : gemset
        File.open( rvm_files[:gemset], 'w') do |f|
          f.puts g
        end
      end
    end
637499
def load_gem(spec)
      load_path = spec.name.gsub('-', '/')
      require load_path

      unless @loaded.include? load_path
        @loaded << load_path
        klass = path_to_class(load_path)
        @log.debug("Loading plugin #{klass} from '#{load_path}'")
        plugins.push plugin_get(klass)
      end
      nil
    end
260453
function linkIfExists(pkgs) {
  const sharedDepsDirs = getSharedDepDirs(pkgs, packageHash);

  if (sharedDepsDirs.length) {
    logPkgsMsg('Linking', sharedDepsDirs);
    linkPackages(sharedDepsDirs);
  } else {
    log('No shared dependencies found');
  }
}