Adds a Gem to the list of Gems to ignore.

 @param [String] name
 @param [String] version
197213
def ignore_gem(name, version, platform)
      ignored_gems[platform] ||= {}
      ignored_gems[platform][name] ||= []
      ignored_gems[platform][name] << version
    end
709796
def named(name)
      resource = all.detect { |resource| resource.name == name }
      if resource.nil?
        raise UnknownResource, "Resource named #{name} doesn't exist"
      else
        resource
      end
    end
1357401
def versions(name, constraint = Semverse::DEFAULT_CONSTRAINT)
      constraint = Semverse::Constraint.coerce(constraint)

      if constraint == Semverse::DEFAULT_CONSTRAINT
        @artifacts_by_name[name]
      else
        @artifacts_by_name[name].select do |artifact|
          constraint.satisfies?(artifact.version)
        end
      end
    end
120763
def by_name(&block)
      if @grouped.nil?
        @grouped = @gems.group_by(&:name).map do |name, collection|
          [name, GemVersionCollection.new(collection)]
        end

        @grouped.reject! do |name, _collection|
          name.nil?
        end

        @grouped.sort_by! do |name, _collection|
          name.downcase
        end
      end

      if block_given?
        @grouped.each(&block)
      else
        @grouped
      end
    end
374663
def versions_for(gem)
      available = @versions_file.versions_for(gem.name)
      return [available.last] if gem.only_latest?

      versions = available.select do |v|
        gem.requirement.satisfied_by?(v[0])
      end

      versions = [available.last] if versions.empty?

      versions
    end
665136
def install_gem(gemname, version=None, conservative=True, ri=False, rdoc=False,
                development=False, format_executable=False, force=False,
                gem_source=None):
    """"""
    cmdline = ['gem', 'install']
    if conservative:
        cmdline.append('--conservative')
    if ri:
        cmdline.append('--ri')
    else:
        cmdline.append('--no-ri')
    if rdoc:
        cmdline.append('--rdoc')
    else:
        cmdline.append('--no-rdoc')
    if development:
        cmdline.append('--development')
    if format_executable:
        cmdline.append('--format-executable')
    if force:
        cmdline.append('--force')
    if version:
        cmdline.extend(['--version', version])
    cmdline.extend(['--clear-sources',
                    '--source', gem_source or RubyGems().gem_source])

    cmdline.append(gemname)

    msg = 'Installing ruby gem: %s' % gemname
    if version:
        msg += ' Version requested: %s' % version
    log.debug(msg)

    try:
        subprocess.check_output(cmdline, shell=False)
    except (OSError, subprocess.CalledProcessError) as err:
        raise error.ButcherError(
            'Gem install failed. Error was: %s. Output: %s' % (
                err, err.output))
867385
def yank_version(name, version, options = {})
      ensure_ready!(:authorization)
      url = "gems/#{escape(name)}/versions/#{escape(version)}"
      response = connection.delete(url, options)
      checked_response_body(response)
    end
764511
public void setCompileVersion(String version) {
        if (version == null || ClassUtils.isBeforeJava6(version)) {
            JavassistCompiler javassistCompiler = new JavassistCompiler();
            javassistCompiler.setLogger(logger);
            javassistCompiler.setCodeDirectory(codeDirectory);
            compiler = javassistCompiler;
        } else {
            JdkCompiler jdkCompiler = new JdkCompiler();
            jdkCompiler.setCompileVersion(version);
            jdkCompiler.setLogger(logger);
            jdkCompiler.setCodeDirectory(codeDirectory);
            compiler = jdkCompiler;
        }
    }
936778
def init(name, version)
      @name = name
      @version = version
      @package_files = Rake::FileList.new
      @package_dir = 'pkg'
      @need_tar = false
      @need_tar_gz = false
      @need_tar_bz2 = false
      @need_zip = false
      @tar_command = 'tar'
      @zip_command = 'zip'
    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
785926
def ensure_cache_version
      return unless cache

      cache_version = cache[cache_key('version')]
      minimum_version = '0.4.0'
      if cache_version &&
         Gem::Version.new(cache_version) < Gem::Version.new(minimum_version)
        @data[:cache] = nil
        raise "OSRM API error: Incompatible cache version #{cache_version}, " +
              "expected #{minimum_version} or higher"
      end
    end
168694
def url(name = nil)
      if name
        if version_identifiers.include?(name.to_s)
          self[:@versions][name.to_s][:@url]
        else
          raise "Invalid Image Version identifier: '#{name}' (must be #{version_identifiers.join(', ')})"
        end
      else
        self[:@url]
      end
    end
1037953
function(name) {
    if (this[name]) {
      this[name].apply(this, [].slice.call(arguments, 1));
    }
    this._super.apply(this, arguments);
  }
394563
def remove_filter(name)
      unless name.is_a? Symbol
        raise ArgumentError,
              "Invalid filter name #{name.inspect} (must be a symbol)"
      end

      unless @filter_chain.delete(name)
        raise ArgumentError,
              "#{name.inspect} not found in filter chain"
      end
    end
400253
def include(context, bundle_name, version):
    
    store = Store(context.obj['database'], context.obj['root'])
    if version:
        version_obj = store.Version.get(version)
        if version_obj is None:
            click.echo(click.style('version not found', fg='red'))
    else:
        bundle_obj = store.bundle(bundle_name)
        if bundle_obj is None:
            click.echo(click.style('bundle not found', fg='red'))
        version_obj = bundle_obj.versions[0]

    try:
        include_version(context.obj['root'], version_obj)
    except VersionIncludedError as error:
        click.echo(click.style(error.message, fg='red'))
        context.abort()

    version_obj.included_at = dt.datetime.now()
    store.commit()
    click.echo(click.style('included all files!', fg='green'))
329177
def map_gems_to_specs(gems)
      gems.map.with_index do |gemfile, index|
        # rubocop:disable Metrics/LineLength
        Utils.logger.info("[#{index + 1}/#{gems.size}]: Processing #{gemfile.split('/')[-1]}")
        # rubocop:enable Metrics/LineLength

        if File.size(gemfile).zero?
          Utils.logger.warn("Skipping zero-length gem: #{gemfile}")
          next
        end

        begin
          spec = if ::Gem::Package.respond_to? :open
                   ::Gem::Package
                     .open(File.open(gemfile, 'rb'), 'r', &:metadata)
                 else
                   ::Gem::Package.new(gemfile).spec
                 end

          spec.loaded_from = gemfile

          # HACK: fuck this shit - borks all tests that use pl1
          if File.basename(gemfile, '.gem') != spec.original_name
            exp = spec.full_name
            exp << " (#{spec.original_name})" if
              spec.original_name != spec.full_name
            msg = "Skipping misnamed gem: #{gemfile} should be named #{exp}"
            Utils.logger.warn(msg)
            next
          end

          version = spec.version.version
          unless version =~ /^\d+\.\d+\.\d+.*/
            msg = "Skipping gem #{spec.full_name} - invalid version #{version}"
            Utils.logger.warn(msg)
            next
          end

          if ::Gem::VERSION >= '2.5.0'
            spec.abbreviate
            spec.sanitize
          else
            abbreviate spec
            sanitize spec
          end

          spec
        rescue SignalException
          msg = 'Received signal, exiting'
          Utils.logger.error(msg)
          raise
        rescue StandardError => e
          msg = ["Unable to process #{gemfile}",
                 "#{e.message} (#{e.class})",
                 "\t#{e.backtrace.join "\n\t"}"].join("\n")
          Utils.logger.debug(msg)
        end
      end.compact
    end
56276
def versions(args = {}, &bl)
      local_args = Hash[args]
      recursive  = local_args[:recursive]
      dev_deps   = local_args[:dev_deps]
      versions   = local_args[:versions] || {}

      gem_versions = Polisher::VersionChecker.versions_for(name, &bl)
      versions.merge! name => gem_versions
      local_args[:versions] = versions

      if recursive
        versions.merge! dependency_versions local_args, &bl
        versions.merge! dependency_versions local_args.merge(:dev => true), &bl if dev_deps
      end

      versions
    end