Sha256: d601c27fcb93293c60f516b88c199c67d1865112a5396065a3c9ef49c74b757f

Contents?: true

Size: 589 Bytes

Versions: 3

Compression:

Stored size: 589 Bytes

Contents

require 'open-uri'

module Capitate::Plugins::Wget
  
  # Download the uri, then upload it into the remote destination directory
  # 
  # ==== Options
  # +uri+:: URI to get
  # +remote_dest_dir+:: Remote destination directory, defaults to /tmp
  #
  def uri(uri, remote_dest_dir = "/tmp")
    
    uri = uri = URI.parse(uri)
    name = uri.path.split("/").last
    remote_dest_path = File.join(remote_dest_dir, name)
    
    logger.info "Downloading #{name} from #{uri}..."      
    put open(uri).read, remote_dest_path    
  end
  
end

Capistrano.plugin :wget, Capitate::Plugins::Wget

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capitate-0.1.7 lib/capitate/plugins/wget.rb
capitate-0.1.9 lib/capitate/plugins/wget.rb
capitate-0.1.8 lib/capitate/plugins/wget.rb