123456789_123456789_123456789_123456789_123456789_

Class: Bundler::Fetcher::Base

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: lib/bundler/fetcher/base.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(downloader, remote, display_uri, gem_remote_fetcher) ⇒ Base

[ GitHub ]

  
# File 'lib/bundler/fetcher/base.rb', line 11

def initialize(downloader, remote, display_uri, gem_remote_fetcher)
  raise "Abstract class" if self.class == Base
  @downloader = downloader
  @remote = remote
  @display_uri = display_uri
  @gem_remote_fetcher = gem_remote_fetcher
end

Instance Attribute Details

#api_fetcher?Boolean (readonly)

[ GitHub ]

  
# File 'lib/bundler/fetcher/base.rb', line 37

def api_fetcher?
  false
end

#available?Boolean (readonly)

[ GitHub ]

  
# File 'lib/bundler/fetcher/base.rb', line 33

def available?
  true
end

#display_uri (readonly)

[ GitHub ]

  
# File 'lib/bundler/fetcher/base.rb', line 7

attr_reader :display_uri

#downloader (readonly)

[ GitHub ]

  
# File 'lib/bundler/fetcher/base.rb', line 6

attr_reader :downloader

#gem_remote_fetcher (readonly)

[ GitHub ]

  
# File 'lib/bundler/fetcher/base.rb', line 9

attr_reader :gem_remote_fetcher

#remote (readonly)

[ GitHub ]

  
# File 'lib/bundler/fetcher/base.rb', line 8

attr_reader :remote

Instance Method Details

#fetch_uri

[ GitHub ]

  
# File 'lib/bundler/fetcher/base.rb', line 23

def fetch_uri
  @fetch_uri ||= if remote_uri.host == "rubygems.org"
    uri = remote_uri.dup
    uri.host = "index.rubygems.org"
    uri
  else
    remote_uri
  end
end

#log_specs(&block) (private)

[ GitHub ]

  
# File 'lib/bundler/fetcher/base.rb', line 43

def log_specs(&block)
  if Bundler.ui.debug?
    Bundler.ui.debug yield
  else
    Bundler.ui.info ".", false
  end
end

#remote_uri

[ GitHub ]

  
# File 'lib/bundler/fetcher/base.rb', line 19

def remote_uri
  @remote.uri
end