Class: Bundler::Fetcher::Base
- Inherits:
-
Object
- Object
- Bundler::Fetcher::Base
- Defined in:
- lib/bundler/fetcher/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#display_uri ⇒ Object
readonly
Returns the value of attribute display_uri.
-
#downloader ⇒ Object
readonly
Returns the value of attribute downloader.
-
#gem_remote_fetcher ⇒ Object
readonly
Returns the value of attribute gem_remote_fetcher.
-
#remote ⇒ Object
readonly
Returns the value of attribute remote.
Instance Method Summary collapse
- #api_fetcher? ⇒ Boolean
- #available? ⇒ Boolean
- #fetch_uri ⇒ Object
-
#initialize(downloader, remote, display_uri, gem_remote_fetcher) ⇒ Base
constructor
A new instance of Base.
- #remote_uri ⇒ Object
Constructor Details
#initialize(downloader, remote, display_uri, gem_remote_fetcher) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 17 |
# 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
#display_uri ⇒ Object (readonly)
Returns the value of attribute display_uri.
7 8 9 |
# File 'lib/bundler/fetcher/base.rb', line 7 def display_uri @display_uri end |
#downloader ⇒ Object (readonly)
Returns the value of attribute downloader.
6 7 8 |
# File 'lib/bundler/fetcher/base.rb', line 6 def downloader @downloader end |
#gem_remote_fetcher ⇒ Object (readonly)
Returns the value of attribute gem_remote_fetcher.
9 10 11 |
# File 'lib/bundler/fetcher/base.rb', line 9 def gem_remote_fetcher @gem_remote_fetcher end |
#remote ⇒ Object (readonly)
Returns the value of attribute remote.
8 9 10 |
# File 'lib/bundler/fetcher/base.rb', line 8 def remote @remote end |
Instance Method Details
#api_fetcher? ⇒ Boolean
37 38 39 |
# File 'lib/bundler/fetcher/base.rb', line 37 def api_fetcher? false end |
#available? ⇒ Boolean
33 34 35 |
# File 'lib/bundler/fetcher/base.rb', line 33 def available? true end |
#fetch_uri ⇒ Object
23 24 25 26 27 28 29 30 31 |
# 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 |
#remote_uri ⇒ Object
19 20 21 |
# File 'lib/bundler/fetcher/base.rb', line 19 def remote_uri @remote.uri end |