carrierwave-scp 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/carrierwave-scp.rb +1 -1
- data/lib/carrierwave-scp/version.rb +1 -1
- data/lib/carrierwave/storage/scp.rb +14 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTNhNzM1YTYyZDBlOTE5MDNiNTE0MzZlMTBlZDhhZjY3NWRkN2M4Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2EwNDVlZDg2NGFjZWYyZjk5MWIxZDFhYWU4N2Y4ZWVhNmFkNGU5YQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmE0MjZkZTIwZWQ2Y2I4YzdjOWNiNDQ1NzU4MGQyODM5MDBjYzQwYzczNGQ0
|
10
|
+
NzM2ZmI5YmQwYzYyMGEwNDRlOGY4N2MyMTRjYTljYzJiZDFhZTNhNDRjOGQx
|
11
|
+
YjgwYjczZTU2NjRjMDMwMzUyMjhjYjE3MWQ4MTE3NmNkMGJhNTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTBlZWZhN2QzNmIxNjZlYjk0MzAzYWU4Yjk2MjhhYzc4YzRhMGU3NjBkZDc4
|
14
|
+
YmM3MjhjNjc0YWJhZjRjODNjMzAwNjAzYTM2MWJkZDQzN2I5MGE1YmFjYWFi
|
15
|
+
MjM4NTZmODZlMDY4M2Y2Nzg1MTIyMzNlMWU2YmI2NjEzMDYyZjU=
|
data/lib/carrierwave-scp.rb
CHANGED
@@ -24,7 +24,7 @@ module CarrierWave
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def read
|
27
|
-
file
|
27
|
+
file
|
28
28
|
end
|
29
29
|
|
30
30
|
def size
|
@@ -32,15 +32,24 @@ module CarrierWave
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def store(new_file)
|
35
|
-
Net::
|
36
|
-
|
37
|
-
|
35
|
+
Net::SSH.start(@uploader.scp_host, @uploader.scp_user, @uploader.scp_options) do |session|
|
36
|
+
new_dir = path.split('/')
|
37
|
+
new_dir.delete(new_dir[-1])
|
38
|
+
new_dir = new_dir.join('/')
|
39
|
+
session.exec! "mkdir #{@uploader.scp_folder}/#{new_dir}"
|
40
|
+
session.scp.upload! new_file.path, "#{@uploader.scp_folder}/#{path}", :recursive => true
|
41
|
+
end
|
38
42
|
end
|
39
43
|
|
40
44
|
private
|
41
45
|
|
42
46
|
def file
|
43
|
-
|
47
|
+
remote_file = nil
|
48
|
+
Net::SSH.start(@uploader.scp_host, @uploader.scp_user, @uploader.scp_options) do |session|
|
49
|
+
remote_file = session.scp.download!("#{@uploader.scp_folder}/#{path}", nil)
|
50
|
+
end
|
51
|
+
remote_file
|
52
|
+
#@file ||= open("scp://#{@uploader.scp_user}:#{@uploader.scp_options[:password]}@#{@uploader.scp_host}#{@uploader.scp_folder}/#{path}", options)
|
44
53
|
end
|
45
54
|
|
46
55
|
end #end File
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-scp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Batista da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|