Class: Vagrant::Downloaders::Base
- Inherits:
-
Object
- Object
- Vagrant::Downloaders::Base
- Includes:
- Util
- Defined in:
- lib/vagrant/downloaders/base.rb
Overview
Represents a base class for a downloader. A downloader handles downloading a box file to a temporary file.
Class Method Summary collapse
-
.match?(url) ⇒ Boolean
Tests whether a URL matches this download.
Instance Method Summary collapse
-
#download!(source_url, destination_file) ⇒ Object
Downloads the source file to the destination file.
-
#initialize(ui) ⇒ Base
constructor
A new instance of Base.
-
#prepare(source_url) ⇒ Object
Called prior to execution so any error checks can be done.
Constructor Details
#initialize(ui) ⇒ Base
Returns a new instance of Base.
8 9 10 |
# File 'lib/vagrant/downloaders/base.rb', line 8 def initialize(ui) @ui = ui end |
Class Method Details
.match?(url) ⇒ Boolean
Tests whether a URL matches this download. Subclasses must
override this and return true
for any URLs they wish to
handle.
15 |
# File 'lib/vagrant/downloaders/base.rb', line 15 def self.match?(url); false; end |
Instance Method Details
#download!(source_url, destination_file) ⇒ Object
Downloads the source file to the destination file. It is up to implementors of this class to handle the logic.
22 |
# File 'lib/vagrant/downloaders/base.rb', line 22 def download!(source_url, destination_file); end |
#prepare(source_url) ⇒ Object
Called prior to execution so any error checks can be done
18 |
# File 'lib/vagrant/downloaders/base.rb', line 18 def prepare(source_url); end |