--- !ruby/object:RI::ClassDescription 
attributes: 
- !ruby/object:RI::Attribute 
  comment: 
  - !ruby/struct:SM::Flow::P 
    body: The underlying Net::SSH session that acts as transport for the SCP packets.
  name: session
  rw: R
class_methods: 
- !ruby/object:RI::MethodSummary 
  name: download!
- !ruby/object:RI::MethodSummary 
  name: new
- !ruby/object:RI::MethodSummary 
  name: start
- !ruby/object:RI::MethodSummary 
  name: upload!
comment: 
- !ruby/struct:SM::Flow::P 
  body: Net::SCP implements the SCP (Secure CoPy) client protocol, allowing Ruby programs to securely and programmatically transfer individual files or entire directory trees to and from remote servers. It provides support for multiple simultaneous SCP copies working in parallel over the same connection, as well as for synchronous, serial copies.
- !ruby/struct:SM::Flow::P 
  body: "Basic usage:"
- !ruby/struct:SM::Flow::VERB 
  body: "  require 'net/scp'\n\n  Net::SCP.start(&quot;remote.host&quot;, &quot;username&quot;, :password =&gt; &quot;passwd&quot;) do |scp|\n    # synchronous (blocking) upload; call blocks until upload completes\n    scp.upload! &quot;/local/path&quot;, &quot;/remote/path&quot;\n\n    # asynchronous upload; call returns immediately and requires SSH\n    # event loop to run\n    channel = scp.upload(&quot;/local/path&quot;, &quot;/remote/path&quot;)\n    channel.wait\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: "Net::SCP also provides an open-uri tie-in, so you can use the Kernel#open method to open and read a remote file:"
- !ruby/struct:SM::Flow::VERB 
  body: "  # if you just want to parse SCP URL's:\n  require 'uri/scp'\n  url = URI.parse(&quot;scp://user@remote.host/path/to/file&quot;)\n\n  # if you want to read from a URL voa SCP:\n  require 'uri/open-scp'\n  puts open(&quot;scp://user@remote.host/path/to/file&quot;).read\n"
- !ruby/struct:SM::Flow::P 
  body: "Lastly, Net::SCP adds a method to the Net::SSH::Connection::Session class, allowing you to easily grab a Net::SCP reference from an existing Net::SSH session:"
- !ruby/struct:SM::Flow::VERB 
  body: "  require 'net/ssh'\n  require 'net/scp'\n\n  Net::SSH.start(&quot;remote.host&quot;, &quot;username&quot;, :password =&gt; &quot;passwd&quot;) do |ssh|\n    ssh.scp.download! &quot;/remote/path&quot;, &quot;/local/path&quot;\n  end\n"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Progress Reporting
- !ruby/struct:SM::Flow::P 
  body: By default, uploading and downloading proceed silently, without any outward indication of their progress. For long running uploads or downloads (and especially in interactive environments) it is desirable to report to the user the progress of the current operation.
- !ruby/struct:SM::Flow::P 
  body: "To receive progress reports for the current operation, just pass a block to #upload or #download (or one of their variants):"
- !ruby/struct:SM::Flow::VERB 
  body: "  scp.upload!(&quot;/path/to/local&quot;, &quot;/path/to/remote&quot;) do |ch, name, sent, total|\n    puts &quot;#{name}: #{sent}/#{total}&quot;\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: Whenever a new chunk of data is recieved for or sent to a file, the callback will be invoked, indicating the name of the file (local for downloads, remote for uploads), the number of bytes that have been sent or received so far for the file, and the size of the file.
constants: []

full_name: Net::SCP
includes: 
- !ruby/object:RI::IncludedModule 
  name: Net::SSH::Loggable
- !ruby/object:RI::IncludedModule 
  name: Upload
- !ruby/object:RI::IncludedModule 
  name: Download
instance_methods: 
- !ruby/object:RI::MethodSummary 
  name: download
- !ruby/object:RI::MethodSummary 
  name: download!
- !ruby/object:RI::MethodSummary 
  name: upload
- !ruby/object:RI::MethodSummary 
  name: upload!
name: SCP
superclass: Object
