class Bundler::RemoteSpecification - bundler-1.6.9 Documentation

# class Bundler::RemoteSpecification

Represents a lazily loaded gem specification, where the full specification is on the source server in rubygems' “quick” index. The proxy object is to be seeded with what we're given from the source's abbreviated index - the full specification will only be fetched when necessary.

### Attributes

name[R]
platform[R]
source[RW]
source_uri[RW]
version[R]

### Public Class Methods

new(name, version, platform, spec_fetcher) click to toggle source

    # File lib/bundler/remote_specification.rb, line 15
    def initialize(name, version, platform, spec_fetcher)
      @name         = name
      @version      = version
      @platform     = platform
      @spec_fetcher = spec_fetcher
    end

### Public Instance Methods

__swap__(spec) click to toggle source

Because Rubyforge cannot be trusted to provide valid specifications once the remote gem is downloaded, the backend specification will be swapped out.

    # File lib/bundler/remote_specification.rb, line 39
    def __swap__(spec)
      @specification = spec
    end

fetch_platform() click to toggle source

Needed before installs, since the arch matters then and quick specs don't bother to include the arch in the platform string

    # File lib/bundler/remote_specification.rb, line 24
    def fetch_platform
      @platform = _remote_specification.platform
    end

full_name() click to toggle source

    # File lib/bundler/remote_specification.rb, line 28
    def full_name
      if platform == Gem::Platform::RUBY or platform.nil? then
        "#{@name}-#{@version}"
      else
        "#{@name}-#{@version}-#{platform}"
      end
    end

### Private Instance Methods

_remote_specification() click to toggle source

    # File lib/bundler/remote_specification.rb, line 45
    def _remote_specification
      @specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform])
    end

method_missing(method, *args, &blk) click to toggle source
Calls superclass method

    # File lib/bundler/remote_specification.rb, line 49
    def method_missing(method, *args, &blk)
      if Gem::Specification.new.respond_to?(method)
        _remote_specification.send(method, *args, &blk)
      else
        super
      end
    end