kate-get 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/kate-get.rb +7 -3
  2. 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
- base_url = site[:base].sub "##source_name##", name
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! base_url, ""
56
- base = File.basename f
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
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Evan Boyd Sosenko