Flowdock
method

setup_fetcher

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: SpecFetcherSetup
setup_fetcher() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/test_utilities.rb, line 305
  def setup_fetcher # :nodoc:
    require 'zlib'
    require 'socket'
    require 'rubygems/remote_fetcher'

    unless @test.fetcher then
      @test.fetcher = Gem::FakeFetcher.new
      Gem::RemoteFetcher.fetcher = @test.fetcher
    end

    Gem::Specification.reset

    begin
      gem_repo, @test.gem_repo = @test.gem_repo, @repository
      @test.uri = URI @repository

      @test.util_setup_spec_fetcher(*@downloaded)
    ensure
      @test.gem_repo = gem_repo
      @test.uri = URI gem_repo
    end

    @gems.each do |spec, gem|
      next unless gem

      @test.fetcher.data["#{@repository}gems/#{spec.file_name}"] =
        Gem.read_binary(gem)

      FileUtils.cp gem, spec.cache_file
    end
  end
Register or log in to add new notes.