Sha256: e6efc2f007181b5ce73897bee15e16dccad90477c306ae17e8ca1684042bfe47

Contents?: true

Size: 555 Bytes

Versions: 16

Compression:

Stored size: 555 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)
          raise Actions::ActionException.new(: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

16 entries across 16 versions & 2 rubygems

Version Path
vagrantup-0.4.3.dev lib/vagrant/downloaders/file.rb
vagrantup-0.4.1 lib/vagrant/downloaders/file.rb
vagrantup-0.4.0 lib/vagrant/downloaders/file.rb
vagrantup-0.3.4 lib/vagrant/downloaders/file.rb
vagrantup-0.3.3 lib/vagrant/downloaders/file.rb
vagrantup-0.3.2 lib/vagrant/downloaders/file.rb
vagrantup-0.3.1 lib/vagrant/downloaders/file.rb
vagrantup-0.3.0 lib/vagrant/downloaders/file.rb
vagrant-0.4.2 lib/vagrant/downloaders/file.rb
vagrant-0.4.1 lib/vagrant/downloaders/file.rb
vagrant-0.4.0 lib/vagrant/downloaders/file.rb
vagrant-0.3.4 lib/vagrant/downloaders/file.rb
vagrant-0.3.3 lib/vagrant/downloaders/file.rb
vagrant-0.3.2 lib/vagrant/downloaders/file.rb
vagrant-0.3.1 lib/vagrant/downloaders/file.rb
vagrant-0.3.0 lib/vagrant/downloaders/file.rb