Class: Gem::SourceIndex

### Home Classes Methods

### In Files

- lib/extlib/rubygems.rb

### Parent

Object

### Methods

- #add_spec

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- Extlib
- Extlib::Assertions
- Extlib::ByteArray
- Extlib::Hook
- Extlib::Hook::ClassMethods
- Extlib::Inflection
- Extlib::LocalObjectSpace
- Extlib::Logger
- Extlib::Pooling
- Extlib::Pooling::InvalidResourceError
- Extlib::Pooling::Pool
- Extlib::SimpleSet
- Gem
- Gem::SourceIndex
- Gem::Specification
- LazyModule
- LazyModule::ClassMethods
- Array
- Class
- DateTime
- Dictionary
- FalseClass
- Hash
- LazyArray
- Mash
- Module
- NilClass
- Numeric
- Object
- ObjectSpace
- Pathname
- REXMLUtilityNode
- String
- Struct
- Symbol
- Time
- ToHashParser
- TrueClass
- VirtualFile

No matching classes.

# Gem::SourceIndex

### Public Instance Methods

add_spec(gem_spec) click to toggle source

Overwrite this so that a gem of the same name and version won't push one from the gems directory out entirely.

@param gem_spec<Gem::Specification> The specification of the gem to add.

    # File lib/extlib/rubygems.rb, line 13
    def add_spec(gem_spec)
      unless gem_spec.instance_variable_get("@loaded_from") &&
        @gems[gem_spec.full_name].is_a?(Gem::Specification) &&
        @gems[gem_spec.full_name].installation_path ==
          File.join(defined?(Merb) && Merb.respond_to?(:root) ? Merb.root : Dir.pwd,"gems")

        @gems[gem_spec.full_name] = gem_spec
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.