Sha256: 17d3c942329636f2e947c3dd0be36b38300bffe5a69ec4f7d6aa80e4543654f2

Contents?: true

Size: 538 Bytes

Versions: 10

Compression:

Stored size: 538 Bytes

Contents

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)
        if !::File.file?(source_url)
          return env.error!(:downloader_file_doesnt_exist, :source_url => source_url)
        end
      end

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

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
vagrantup-0.5.4 lib/vagrant/downloaders/file.rb
vagrantup-0.5.3 lib/vagrant/downloaders/file.rb
vagrantup-0.5.2 lib/vagrant/downloaders/file.rb
vagrantup-0.5.1 lib/vagrant/downloaders/file.rb
vagrantup-0.5.0 lib/vagrant/downloaders/file.rb
vagrant-0.5.4 lib/vagrant/downloaders/file.rb
vagrant-0.5.3 lib/vagrant/downloaders/file.rb
vagrant-0.5.2 lib/vagrant/downloaders/file.rb
vagrant-0.5.1 lib/vagrant/downloaders/file.rb
vagrant-0.5.0 lib/vagrant/downloaders/file.rb