Class: Vagrant::Downloaders::Base

Inherits:
Object
  • Object
show all
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.

Direct Known Subclasses

File, HTTP

Class Method Summary collapse

Instance Method Summary collapse

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.

Returns:

  • (Boolean)


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.



19
# File 'lib/vagrant/downloaders/base.rb', line 19

def download!(source_url, destination_file); end