Sha256: 7ac87c830d9d1fad88ada04858821b01f8d43a14a04c98be1e48584ceda3efdd
Contents?: true
Size: 776 Bytes
Versions: 4
Compression:
Stored size: 776 Bytes
Contents
# Copyright: Copyright (c) 2005 Nicolas Pouillard. All rights reserved. # Author: Nicolas Pouillard <ertai@lrde.epita.fr>. # License: Gnu General Public License. # $LastChangedBy: polrop $ # $Id: ftp_ex.rb 159 2005-02-18 12:07:23Z polrop $ require 'uri_ex' require 'uri/ftp' require 'net/ftp' require 'mktemp' module URI class FTP def checkout tmp = TempPath.new('checkout', pathname.basename.to_s) begin Net::FTP.open(host) do |ftp| ftp.login ftp.passive = true ftp.getbinaryfile(path, tmp) end rescue Exception => ex tmp.unlink if tmp.exist? raise CheckoutError, "Cannot checkout #{to_s} (error: #{ex.short_pp})" end tmp end end # class FTP end # module URI
Version data entries
4 entries across 4 versions & 2 rubygems
Version | Path |
---|---|
ttk-0.1.576 | ruby_ex/uri/ftp_ex.rb |
ttk-0.1.579 | ruby_ex/uri/ftp_ex.rb |
ttk-0.1.580 | ruby_ex/uri/ftp_ex.rb |
vcs-0.2.148 | ruby_ex/uri/ftp_ex.rb |