Class: Logcli::SCP
- Inherits:
-
Object
- Object
- Logcli::SCP
- Defined in:
- lib/logcli/scp.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #download(remote_path, local_dest) ⇒ Object
-
#initialize(params) ⇒ SCP
constructor
A new instance of SCP.
Constructor Details
#initialize(params) ⇒ SCP
Returns a new instance of SCP.
4 5 6 |
# File 'lib/logcli/scp.rb', line 4 def initialize params @params = params end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
3 4 5 |
# File 'lib/logcli/scp.rb', line 3 def params @params end |
Instance Method Details
#download(remote_path, local_dest) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/logcli/scp.rb', line 8 def download remote_path, local_dest Net::SCP.start(*params.scp_args) do |scp| scp.download remote_path, local_dest do |ch, name, sent, total| puts "#{name}: #{sent}/#{total}" end end end |