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) ⇒ Base

[ GitHub ]

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

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

Instance Attribute Details

#api_fetcher?Boolean (readonly)

[ GitHub ]

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

def api_fetcher?
  false
end

#available?Boolean (readonly)

[ GitHub ]

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

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

#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 21

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(debug_msg) (private)

[ GitHub ]

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

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

#remote_uri

[ GitHub ]

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

def remote_uri
  @remote.uri
end