Sha256: 1528cafb66d81708f0bdb2b7bb4e68233e0383a7d893f6b3b4b2843a86a33783

Contents?: true

Size: 743 Bytes

Versions: 40

Compression:

Stored size: 743 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

      # Called prior to execution so any error checks can be done
      def prepare(source_url); 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

40 entries across 40 versions & 6 rubygems

Version Path
bmhatfield-vagrant-1.0.10 lib/vagrant/downloaders/base.rb
bmhatfield-vagrant-1.0.9 lib/vagrant/downloaders/base.rb
bmhatfield-vagrant-1.0.8 lib/vagrant/downloaders/base.rb
bmhatfield-vagrant-1.0.7 lib/vagrant/downloaders/base.rb
vagrantup-1.0.7 lib/vagrant/downloaders/base.rb
vagrantup-1.0.6 lib/vagrant/downloaders/base.rb
vagrantup-1.0.5 lib/vagrant/downloaders/base.rb
vagrantup-1.0.4 lib/vagrant/downloaders/base.rb
vagrantup-1.0.3 lib/vagrant/downloaders/base.rb
vagrantup-1.0.2 lib/vagrant/downloaders/base.rb
vagrantup-1.0.1 lib/vagrant/downloaders/base.rb
vagrantup-1.0.0 lib/vagrant/downloaders/base.rb
vagrantup-0.9.99.2 lib/vagrant/downloaders/base.rb
vagrantup-0.9.99.1 lib/vagrant/downloaders/base.rb
vagrantup-0.9.7 lib/vagrant/downloaders/base.rb
vagrantup-0.9.6 lib/vagrant/downloaders/base.rb
vagrantup-0.9.5 lib/vagrant/downloaders/base.rb
vagrantup-0.9.4 lib/vagrant/downloaders/base.rb
vagrantup-0.9.3 lib/vagrant/downloaders/base.rb
vagrantup-0.9.2 lib/vagrant/downloaders/base.rb