Generate the plugin resolver set. Optionally provide specification names (short or
 full) that should be ignored

 @param [Pathname] path to plugins
 @param [Array<String>] gems to skip
 @return [PluginSet]
2860
def generate_plugin_set(*args)
      plugin_path = args.detect{|i| i.is_a?(Pathname) } || plugin_gem_path
      skip = args.detect{|i| i.is_a?(Array) } || []
      plugin_set = PluginSet.new
      @logger.debug("Generating new plugin set instance. Skip gems - #{skip}")
      Dir.glob(plugin_path.join('specifications/*.gemspec').to_s).each do |spec_path|
        spec = Gem::Specification.load(spec_path)
        desired_spec_path = File.join(spec.gem_dir, "#{spec.name}.gemspec")
        # Vendor set requires the spec to be within the gem directory. Some gems will package their
        # spec file, and that's not what we want to load.
        if !File.exist?(desired_spec_path) || !FileUtils.cmp(spec.spec_file, desired_spec_path)
          File.write(desired_spec_path, spec.to_ruby)
        end
        next if skip.include?(spec.name) || skip.include?(spec.full_name)
        plugin_set.add_vendor_gem(spec.name, spec.gem_dir)
      end
      plugin_set
    end
725768
def gemset_present(name, ruby='default', user=None):
    '''
    
    '''
    ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}

    ret = _check_rvm(ret, user)
    if ret['result'] is False:
        return ret

    if '@' in name:
        ruby, name = name.split('@')
        ret = _check_ruby(ret, ruby)
        if not ret['result']:
            ret['result'] = False
            ret['comment'] = 'Requested ruby implementation was not found.'
            return ret

    if name in __salt__['rvm.gemset_list'](ruby, runas=user):
        ret['result'] = True
        ret['comment'] = 'Gemset already exists.'
    else:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'Set to install gemset {0}'.format(name)
            return ret
        if __salt__['rvm.gemset_create'](ruby, name, runas=user):
            ret['result'] = True
            ret['comment'] = 'Gemset successfully created.'
            ret['changes'][name] = 'created'
        else:
            ret['result'] = False
            ret['comment'] = 'Gemset could not be created.'

    return ret
371273
def names
      plugins.reduce({}) do |hash, plugin|
        hash[plugin.name] = plugin
        hash
      end
    end
990166
function Resolver(root, dot, sep) {
    if (!Is.instance(this, Resolver)) {
        return PKG.Builder(root, dot, sep).get();
    }

    this.aliases = {};
    /**
     * Root path.
     *
     * @private
     * @type {string}
     */
     this.root = PKG.ROOT;
    /**
     * Character separator used in path keys.
     *
     * @private
     * @type {string}
     * @default {@link Dotresolver.DOT}
     */
    this.dot = dot || PKG.DOT;
    /**
     * Character separator used in built path.
     *
     * @private
     * @type {string}
     * @default {@link Dotresolver.SEP}
     */
    this.sep = sep || PKG.SEP;

    this.setRoot(root);
}
1315120
function resolvePaths(paths) {
  var exec = {};
  var originalWd = process.cwd();
  for (var name in paths) {
    process.chdir(originalWd);
    exec[name] = resolveLink(paths[name]);
    process.chdir(originalWd);
  }
  process.chdir(originalWd);
  return exec;
}
943563
def determine_resolver(params)
      if params[:resolver]
        Djatoka::Resolver.new(params[:resolver])
      elsif Djatoka.resolver
        Djatoka.resolver
      else
        nil
      end
    end
611856
def fetch_gemspec(gem, version)
      filename = gem.gemspec_filename(version)
      satisfied = if gem.only_latest?
                    true
                  else
                    gem.requirement.satisfied_by?(version)
                  end

      if gemspec_exists?(filename) || !satisfied
        Utils.logger.debug("Skipping #{filename}")
        return
      end

      Utils.logger.info("Fetching #{filename}")
      fetch_from_source(filename, gem, version, true)
    end
202830
function resolvePluginPath(config, file, mdirs) {
  if (_lodash2.default.size(config.plugins)) {
    config.plugins = _lodash2.default.reduce(config.plugins, (res, p, k) => {
      if (!_path2.default.isAbsolute(p)) {
        if (p[0] === '.') {
          p = _path2.default.join(file, p);
        } else {
          for (let dir of mdirs) {
            p = _path2.default.join(dir, p);
            if ((0, _utils.isDirectory)(p)) {
              break;
            }
          }
        }
      }
      res[k] = p;
      return res;
    }, {});
  }
}
1328441
def load_compass
        if Gem::Specification::find_all_by_name('compass').any?
          require 'compass'
          Compass.sass_engine_options[:load_paths].each do |path|
            Sass.load_paths << path
          end
        end
      end
1014569
def load_gems
      load_paths
      prospective_gems.each do |prospect|
        gem_name = prospect.dup
        begin
          loaded = @proxy.proxy(Kernel, :require, gem_name)
          # puts "Loading Gem: #{gem_name} => #{loaded}"
        rescue LoadError, NameError => e
          old_gem_name = gem_name.dup
          gem_name.gsub!('-', '/')
          retry if old_gem_name != gem_name
        end
      end
    end
410549
def generate
      siba_file.run_this do
        file_path = @name.gsub /\.yml$/, ""
        file_path += ".yml"
        file_path = siba_file.file_expand_path file_path
        if siba_file.file_file?(file_path) || siba_file.file_directory?(file_path)
          raise Siba::Error, "Options file already exists: #{file_path}"
        end

        options_data = []
        Siba::Plugins::PLUGINS_HASH.each do |category, types|
          type = nil
          if types.size > 1
            max_type_length = types.keys.max do |a,b|
              a.length <=> b.length
            end.length + 5

            siba_kernel.puts "\nChoose #{category} plugin:"
            types.keys.each_index do |i|
              type = types.keys[i]
              siba_kernel.puts "  #{i+1}. #{Siba::Plugins.plugin_type_and_description(category, type, max_type_length)}"
            end

            type = Siba::Generator.get_plugin_user_choice types.keys
            if type.nil?
              siba_kernel.puts "Cancelled by user"
              return
            end

            unless Siba::InstalledPlugins.installed? category, type
              siba_kernel.puts Siba::InstalledPlugins.install_gem_message(category, type)
              return
            end
          else
            type = types.keys.first
          end

          options = Siba::Generator.load_plugin_yaml_content category, type
          unless options =~ /^\s*type:/
            options = "type: #{type}\n" + options
          end

          options.gsub! /^/, "  "
          options = "#{category}:\n" + options
          options_data << options
        end

        file_data = options_data.join("\n")
        file_data = "# SIBA options file\n" + file_data
        dest_dir = File.dirname file_path
        siba_file.file_utils_mkpath(dest_dir) unless siba_file.file_directory?(dest_dir)
        Siba::FileHelper.write file_path, file_data
        file_path
      end
    end
529782
def plugins_path
      if site.config["plugins_dir"].eql? Bunto::Configuration::DEFAULTS["plugins_dir"]
        [site.in_source_dir(site.config["plugins_dir"])]
      else
        Array(site.config["plugins_dir"]).map { |d| File.expand_path(d) }
      end
    end
501590
def resolve_files(file_or_dir_path, options = {}, &block)
      options = {
        # Set to :template when calling to consider references to template
        # files from an import library
        import: false
      }.merge(options)
      [file_or_dir_path].flatten.each do |file_or_dir_path|
        path = inject_import_path(file_or_dir_path, type: options[:import]) if options[:import]
        path = clean_path_to(file_or_dir_path, options)
        self.base_directory = path unless options[:internal_call]
        if path.directory?
          Dir.glob("#{path}/*").sort.each do |file|
            resolve_files(file, { internal_call: true }.merge(options), &block)
          end
        else
          # Ignore files with the given prefix if supplied, but only if this is a file that
          # has been found, if explicitly asked to compile a file from the caller do it regardless
          if options[:ignore_with_prefix] && options[:internal_call]
            return nil if path.basename.to_s =~ /^#{options[:ignore_with_prefix]}/
          end
          yield path
        end
      end
    end
288957
def gemspec_filename(gem_version = nil)
      gem_version ||= version.to_s
      n = [name, gem_version]
      n.push(@platform) if @platform != 'ruby'
      "#{n.join('-')}.gemspec.rz"
    end
256345
def resolve
      return nil if tried_resolve?
      resolvers.each do |resolver_config|
        begin
          resolver = resolver_config[:resolver]
          if resolver.respond_to?(:call)
            result = resolver.call(resolver_config[:hint], self)
          else
            result = resolver.new(resolver_config[:hint], self).resolve
          end
        rescue StandardError => ex
          raise ex, "Resolver '#{resolver_config[:origin]}' for '#{name}' : #{ex.message}"
        end
        unless result.nil?
          @origin = resolver_config[:origin]
          return result
        end
      end
      nil
    ensure
      set_tried
    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
955646
private static function pluginFolderPaths($plugins, $folder_path)
    {
        $paths = [];

        foreach ($plugins as $path) {
            $iterator = new \DirectoryIterator($path);

            /** @var \DirectoryIterator $directory */
            foreach ($iterator as $directory) {
                if (!$directory->isDir() || $directory->isDot()) {
                    continue;
                }

                // Path to the languages folder
                $lang_path = $directory->getPathName() . '/' . $folder_path;

                // If this folder exists, add it to the list of paths
                if (file_exists($lang_path)) {
                    $paths []= $lang_path;
                }
            }
        }
        return $paths;
    }