kate-get 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/kate-get.rb +7 -3
- metadata +2 -2
data/lib/kate-get.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
1
3
|
# Main class for Kate-Get.
|
2
4
|
class KateGet
|
3
5
|
|
@@ -47,13 +49,15 @@ class KateGet
|
|
47
49
|
|
48
50
|
# Prepare the elements for the rsync command.
|
49
51
|
root_dir = site[:root].sub "##source_name##", name
|
50
|
-
|
52
|
+
base = site[:base].sub "##source_name##", name
|
51
53
|
|
52
54
|
# Skip the file if it is not in the root directory of the source.
|
53
55
|
next unless f[root_dir]
|
54
56
|
|
55
|
-
f.sub!
|
56
|
-
|
57
|
+
f.sub! base, ""
|
58
|
+
|
59
|
+
dir = "#{File.expand_path site[:local]}#{File.dirname f}"
|
60
|
+
FileUtils.mkdir_p dir unless File.directory? dir
|
57
61
|
|
58
62
|
rsync = "rsync -a -e 'ssh -p #{remote[:port]}' #{remote[:user]}@#{remote[:host]}:#{root_dir}/#{f} #{site[:local]}/#{f}"
|
59
63
|
|