Class: Vagrant::Downloaders::File

Inherits:
Base
  • Object
show all
Defined in:
lib/vagrant/downloaders/file.rb

Overview

“Downloads” a file to a temporary file. Basically, this downloader simply does a file copy.

Instance Method Summary collapse

Methods included from Util

#error_and_exit, included, #logger, #wrap_output

Instance Method Details

#download!(source_url, destination_file) ⇒ Object



16
17
18
# File 'lib/vagrant/downloaders/file.rb', line 16

def download!(source_url, destination_file)
  FileUtils.cp(source_url, destination_file.path)
end

#prepare(source_url) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/vagrant/downloaders/file.rb', line 6

def prepare(source_url)
  if !::File.file?(source_url)
    raise Actions::ActionException.new(<<-msg)
The given box does not exist on the file system:

#{source_url}
msg
  end
end