Sha256: 2ced0d34bfa9ba5a31b1c7265534f4937e1e16a7504525cb43a7168917f5376e

Contents?: true

Size: 565 Bytes

Versions: 40

Compression:

Stored size: 565 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)
        env.ui.info I18n.t("vagrant.downloaders.file.download")
        FileUtils.cp(source_url, destination_file.path)
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 5 rubygems

Version Path
vagrantup-0.8.9 lib/vagrant/downloaders/file.rb
vagrantup-0.8.8 lib/vagrant/downloaders/file.rb
vagrantup-0.8.7 lib/vagrant/downloaders/file.rb
vagrantup-0.8.6 lib/vagrant/downloaders/file.rb
vagrantup-0.8.5 lib/vagrant/downloaders/file.rb
vagrantup-0.8.4 lib/vagrant/downloaders/file.rb
vagrantup-0.8.3 lib/vagrant/downloaders/file.rb
vagrantup-0.8.2 lib/vagrant/downloaders/file.rb
vagrantup-0.8.10 lib/vagrant/downloaders/file.rb
vagrantup-0.8.1 lib/vagrant/downloaders/file.rb
vagrantup-0.8.0 lib/vagrant/downloaders/file.rb
vagrantup-0.7.8 lib/vagrant/downloaders/file.rb
vagrantup-0.7.7 lib/vagrant/downloaders/file.rb
vagrantup-0.7.6 lib/vagrant/downloaders/file.rb
vagrantup-0.7.5 lib/vagrant/downloaders/file.rb
vagrantup-0.7.4 lib/vagrant/downloaders/file.rb
vagrantup-0.7.3 lib/vagrant/downloaders/file.rb
vagrantup-0.7.2 lib/vagrant/downloaders/file.rb
vagrantup-0.7.1 lib/vagrant/downloaders/file.rb
vagrantup-0.7.0 lib/vagrant/downloaders/file.rb