Sha256: 2c9b9c1299a22f562ccf341d0cbd921811b52ba43cc7dec39b97fd63f6da1eb0

Contents?: true

Size: 501 Bytes

Versions: 3

Compression:

Stored size: 501 Bytes

Contents

require 'fileutils'

module Vagrant
  module Downloaders
    # "Downloads" a file to a temporary file. Basically, this downloader
    # simply does a file copy.
    class File < Base
      def self.match?(uri)
        ::File.exists?(uri)
      end

      def prepare(source_url)
        raise Errors::DownloaderFileDoesntExist if !::File.file?(source_url)
      end

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

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
vagrantup-0.6.9 lib/vagrant/downloaders/file.rb
vagrant-0.7.0.beta lib/vagrant/downloaders/file.rb
vagrant-0.6.9 lib/vagrant/downloaders/file.rb