class Bundler::RubygemsIntegration::Future - bundler-1.9.9 Documentation

# class Bundler::RubygemsIntegration::Future

Rubygems 2.0

### Public Instance Methods

all_specs() click to toggle source

    # File lib/bundler/rubygems_integration.rb, line 506
    def all_specs
      Gem::Specification.to_a
    end

build(spec, skip_validation = false) click to toggle source

    # File lib/bundler/rubygems_integration.rb, line 554
    def build(spec, skip_validation = false)
      require 'rubygems/package'
      Gem::Package.build(spec, skip_validation)
    end

download_gem(spec, uri, path) click to toggle source

    # File lib/bundler/rubygems_integration.rb, line 539
    def download_gem(spec, uri, path)
      require 'resolv'
      uri = Bundler::Source.mirror_for(uri)
      proxy, dns = configuration[:http_proxy], Resolv::DNS.new
      fetcher = Gem::RemoteFetcher.new(proxy, dns)
      fetcher.download(spec, uri, path)
    end

fetch_all_remote_specs() click to toggle source

    # File lib/bundler/rubygems_integration.rb, line 523
    def fetch_all_remote_specs
      # Since SpecFetcher now returns NameTuples, we just fetch directly
      # and unmarshal the array ourselves.
      hash = {}

      Gem.sources.each do |source|
        source = URI.parse(source.to_s) unless source.is_a?(URI)
        hash[source] = fetch_specs(source, "specs")

        pres = fetch_specs(source, "prerelease_specs")
        hash[source].push(*pres) if pres && !pres.empty?
      end

      hash
    end

fetch_specs(source, name) click to toggle source

    # File lib/bundler/rubygems_integration.rb, line 514
    def fetch_specs(source, name)
      path = source + "#{name}.#{Gem.marshal_version}.gz"
      string = Gem::RemoteFetcher.fetcher.fetch_path(path)
      Bundler.load_marshal(string)
    rescue Gem::RemoteFetcher::FetchError => e
      # it's okay for prerelease to fail
      raise e unless name == "prerelease_specs"
    end

find_name(name) click to toggle source

    # File lib/bundler/rubygems_integration.rb, line 510
    def find_name(name)
      Gem::Specification.find_all_by_name name
    end

gem_from_path(path, policy = nil) click to toggle source

    # File lib/bundler/rubygems_integration.rb, line 547
    def gem_from_path(path, policy = nil)
      require 'rubygems/package'
      p = Gem::Package.new(path)
      p.security_policy = policy if policy
      return p
    end

repository_subdirectories() click to toggle source

    # File lib/bundler/rubygems_integration.rb, line 559
    def repository_subdirectories
      Gem::REPOSITORY_SUBDIRECTORIES
    end

stub_rubygems(specs) click to toggle source

    # File lib/bundler/rubygems_integration.rb, line 498
    def stub_rubygems(specs)
      Gem::Specification.all = specs

      Gem.post_reset do
        Gem::Specification.all = specs
      end
    end