Sha256: 0c13e5c8f29aa5e68fbce26d9c9f7b2a3a4e3a7a0d9b68e20da31a3783d74af4

Contents?: true

Size: 641 Bytes

Versions: 7

Compression:

Stored size: 641 Bytes

Contents

module Vagrant
  module Downloaders
    # Represents a base class for a downloader. A downloader handles
    # downloading a box file to a temporary file.
    class Base
      include Vagrant::Util

      def initialize(ui)
        @ui = ui
      end

      # Tests whether a URL matches this download. Subclasses must
      # override this and return `true` for any URLs they wish to
      # handle.
      def self.match?(url); false; end

      # Downloads the source file to the destination file. It is up to
      # implementors of this class to handle the logic.
      def download!(source_url, destination_file); end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
vagrantup-1.1.3 lib/vagrant/downloaders/base.rb
vagrantup-1.1.2 lib/vagrant/downloaders/base.rb
vagrantup-1.1.1 lib/vagrant/downloaders/base.rb
vagrantup-1.1.0 lib/vagrant/downloaders/base.rb
vagrantup-1.1.4 lib/vagrant/downloaders/base.rb
vagrant-actionio-0.0.9 vendor/bundle/bundler/gems/vagrant-c74251a1d9c0/lib/vagrant/downloaders/base.rb
vagrant-lxc-0.0.1 vendor/vagrant/lib/vagrant/downloaders/base.rb