file_transfer_mixin 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,20 +25,20 @@ module FileTransferMixin
25
25
  end
26
26
 
27
27
  def sftp_send(key, remote_path, local_path)
28
- sftp_block(key) do |sftp|
29
- sftp.upload!(local_path, remote_path)
30
- end
28
+ perform :upload!, key, local_path, remote_path
31
29
  end
32
30
 
33
31
  def sftp_fetch(key, remote_path, local_path)
34
- sftp_block(key) do |sftp|
35
- sftp.download!(remote_path, local_path)
36
- end
32
+ perform :download!, key, remote_path, local_path
37
33
  end
38
34
 
39
35
  def sftp_move(key, original_remote_path, new_remote_path)
36
+ perform :rename!, key, original_remote_path, new_remote_path
37
+ end
38
+
39
+ def perform(action, key, *args)
40
40
  sftp_block(key) do |sftp|
41
- sftp.rename!(original_remote_path, new_remote_path)
41
+ sftp.send(action, args)
42
42
  end
43
43
  end
44
44
 
@@ -1,3 +1,3 @@
1
1
  module FileTransferMixin
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Josh Adams
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-07 00:00:00 -06:00
17
+ date: 2011-03-08 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency